This is one of the most important aspects of dog ownership. Just like any other type of training, this requires time and patience from you, the human.
When training a dog to have proper potty etiquette it is important to recognize that dogs usually want to go potty on a particular surface. So, if the dog was brought up in a kennel and was not allowed to go potty on grass, but only in his own kennel, he will be comfortable going on cement. With that said, you need to train him to go on an acceptable surface, such as grass.
Also, dogs are clean animals. Typically, dogs do not want to soil the area where they sleep or eat. So having a crate or den like area where the dog can rest, is a great way to keep your dog from soiling in the rest of your house while you’re away. Then once your home, you must immediately bring your dog (start on leash) to an area and surface that is appropriate. Once you’re at this spot, give your dog a command to “go potty”. After your dog has done so, reward him minimally with praise and maybe add treats as a reward, especially if this area of training has been a struggle. So once he has done his business, reward with praise and a treat.
So in summary, the steps in teaching your dog to go potty outside on a certain spot, start by not allowing him access to areas you don’t want him to go. That is why a crate is so important for when your not at home. Then, when you come home, immediately bring your dog on leash to the spot of where you want him to go. It’s very important that you are part of the experience of teaching him to go potty and then rewarding after he has finished.