It is simple you train the dog when it is a puppy. I have had many dogs over the years and it is a matter of patience and taking the time to teach your puppy. In older dogs it is more difficult as they would not know what you expect.
My puppy who is no longer a puppy is hard work and I used to take him outside every couple of hours to the garden. You will find they understand and will get used to going to toilet in the garden. A dog, especially a male likes to mark their territory and will take pride where they do their business.
You will find after a while they will actually ask you to go out side and will even wake you at night. The one occasion it didn't happen and maybe he tried to wake me but he actually pooped in the bath. That is smart and knows not to do it in the house,
If you are having a struggle then spend sometime and take your dog out often. If he has weed and pooped on your steps then clean it off with detergent removing the smell and he /she won't do it there any more. If you want them to poop in one place then remove old pop and put it there attracting them to that spot. If that doesn't work find another dogs poop and put it there and i guarantee you they will poop there from then on.
Territory marking is a big thing with dogs. Have you noticed when you take a dog for a walk they are always sniffing poles and things. This is because they can smell another dog has marked the pole before them forcing them now to remark it with their scent.