I adopted a rescue dog when he was about 10 months old. I have had him for 3 months now. It took a few weeks for him to start showing aggression. He never shows any aggression in public, just when visitors enter the home. In public, he usually ignores people, but allows anyone to pet him. He lunges and bites visitors whenever they move inside the home, but will cuddle with them and take treats/toys if they remain stationary (regardless of gender, but has never interacted with a child at home). He was always nice and polite to these same visitors if he encountered them outside the home. To help, I ask visitors if they can meet him outside to allow him to get comfortable with them or keep him away from visitors altogether. We have completed beginner dog training, and we continue to review these basic commands, which he never has a problem with. I make him wait before he eats or goes out the door to show that I'm in charge, like the trainer recommended. He never goes into his crate for punishment. He never had any problems in public or other people's homes. But, when we went to visit family for the holidays, he bit someone for the first time in another person's home. For instance, at my parents' house he would take treats from my father or try to sneak food off his plate as long as my father is seated. He will roam the house freely acting as if nothing is out of the ordinary. But as soon as my father stands up, I have to hold on to the dog to keep from him from biting my father. My family had all been warned, so they handled it well and let me take charge. I reward him whenever he has a good interaction, but had to get a muzzle for him to protect my family members. I think the surprise new places and new people made his behavior worse, but what can I do to prevent this behavior in the future, both in my home and visiting family, and also prevent the behavior from appearing in public?