Keep a Regular Schedule
At minimum, most dogs need to eliminate shortly after each meal as well as when they wake up in the morning or after a nap. Young puppies may need to go out much more frequently; In some cases, every 20-30 minutes. Take your dog out as often as needed to prevent accidents.
Find a Designated Area
For each potty break, take your dog out on a leash to the area you want him to use. Stay quiet; nothing fun happens until he goes potty.
Reward Your Dog
As soon as he eliminates, praise and reward him with a tasty treat. You want your dog to be very motivated to "go" every time you take him out, even if he doesn't really need to. This gives him lots of practice and makes it less likely that he will need to pee between walks.
Supervise Your Dog
Inside, keep a close eye on your pup. When your puppy's awake and moving around you should have both eyes on him at all times. This can feel like a full time job, but don't worry! It gets easier as your pup becomes more reliable. If he's napping or engages with a chew toy, you can safely do something else. Just stay aware of where he is.
Use a Crate
When your dog is home alone he should be crated. Most dogs will instinctually avoid soiling the area that they sleep in.
Clean Up Accidents
Even with a consistent schedule and good supervision, your pup will occasionally forget and male a mess. Use a good quality enzyme cleaner to thoroughly treat any urine spots. This will ensure that there is no trace odor left behind.
Wait a Week
Once your pup has gone at least a week without any accidents, start to give him more freedom at home without supervision. If he forgets and makes a mess, go back to watching him closely and taking him out more often for a few days and then try again.
Most puppies are not reliably house trained until they are 6-8 months old. Newly adopted adult dogs may catch on more quickly, but expect to spend several weeks making sure that they understand the rules in their new environment.