Potty training dogs is easiest when they are young puppies, and this rather long page outlines a basic method. There is a list of tips:
With adult dogs and older puppies who are not housebroken, you often have more of an uphill battle because they have some undesirable habits to unlearn. There's a section on potty training dogs when they are older further down this page.
The key to success is the timing of IN and OUT. Young puppies take IN food or water and usually within 15 or 20 minutes, they pee or poop OUT.
So your job is to get the puppy to where you want him to be in time for that OUT moment.
You have a life and you won't always be there, even if you are just answering the phone. So cleanup is part of the process of potty training dogs.
Here are the basics of a simple potty training routine for a puppy.
1. Take him outside (and stay till he's done or a long time has gone by with no results):
As soon as he wakes up in the morning (You don't have to be awake.. much!)
Right after his breakfast
Right after his lunch
Right after his naps
Right after taking him out of his crate
Right after his dinner
Right after any snacks of much size
Right before his bedtime
If he whimpers in the night
Praise him in a cheery voice when he produces.
2. Only feed him and give him water when you can take him outside right away. Especially in a hot or dry climate, you would normally never let dogs be without access to fresh water, but for the weeks that you are training, this limitation will speed up the potty training process for your dog. There will be fewer accidents and so the dog will more quickly learn what you want. But use your judgment about any risk of dehydration. House training dogs and puppies is a matter of using judgment all along!
3. When he does pee or poop where you don't want him to, quietly clean it up in a matter-of-fact way. This isn't a time to talk either loving or annoyed talk to him; essentially ignore him while you do the cleanup. Certainly never yell or physically punish him in any way.
4. When you and he are both home, keep him with you as much as you can, whether at your side (a leash can be handy for this once he accepts it), in a confined area, or in a crate, or otherwise nearby. (If you are crate-training, do keep the puppy in the crate as little as possible.)