You may have certain rooms in your house you do not want your dog to visit. Whether it is a guest room you would like to keep free of pet hair, a room with fragile knickknacks, or even a room where the cat uses his litter box, it does not matter the reason; it is important to you if you want your dog to stay away from it. This becomes beneficial when you have company over and you want to keep your dog out of a certain area temporarily. This also works, of course, when you do not want your dog in a room at all. Many people don't allow their dogs in the kitchen because they do not want animal fur on their counters or in their food or even in the air around cooking supplies.
You can teach your dog to stay out of a certain room with simple and consistent training. Boundary training is what you will be teaching when you let your dog know he is allowed to go to certain places and not to others. Once you have your dog trained to stay in certain areas, or out of other areas, you can teach boundary training outdoors as well. Be patient with training as your dog gets used to where he can be and where he cannot be. Giving your dog boundaries will actually strengthen your relationship with your dog. He wants to see you as the leader of his pack so he will look for boundaries from you, but be prepared because he will also push boundaries every now and then.
To teach your dog to stay out of a certain room in your home, you are going to want to be sure to have a way to block off the room during training and a way to watch your dog while you are teaching him not to go into that room. Be sure once you pick a room your dog is not allowed to enter, that you keep it off-limits when you are not supervising so he is not set up to fail. Have tasty treats on hand to reward your dog for good behavior and a key phrase like ‘ah ah’ or ‘uh oh’ to use when your dog pushes those boundaries and enters the room he is not supposed to enter.