It will only respond to or obey one person and ignores the other person, or misbehaves when the other person is not there. The good news is that this common issue can be resolved quite simply by going back to basic training, positive reinforcement training works best long-term.
A dog will not automatically know what you want them to do. You will have to be prepared to teach them the behaviors that you expect from them. They will have to be taught their boundaries.