Walk your puppy every hour on the hour when you are home. If your puppy is playing heavily or can not go this long you may need to take them out more frequently.
Walk your puppy after every nap, meal, drink, activity change and any time you see your puppy start sniffing the floor or walking in circles.
Crate your puppy anytime you are not directly supervising them. You can also tether your puppy to you with a 4-6 foot long leash. A crate must be just big enough to stand up, turn around and lie down comfortably.
Even if you have a fenced yard take your puppy to the same spot ON leash every time you go out. Use the same door to exit the house. Consistency is key and you need to create a specific pattern for your puppy to learn from.
Give your puppy a very special treat immediately upon finishing pottying. Do NOT wait until you get inside! On the spot, but make sure they are done or you will distract them going and they will likely end up finishing inside!
Go to the potty place and stand there for 3 minutes. Do not speak to, look at or acknowledge your puppy. Just stand there in one spot like a post. If after 3 minutes your puppy has not gone, quietly bring them inside and put them in their crate for about 20 minutes, then try again. Follow this 3 and 20 rule until your puppy has emptied outside, then treats and play!
If your puppy wakes up overnight, take him outside! Same as above, 3 minutes then back inside. Don't worry about "teaching your puppy to wake up overnight". He will eventually sleep through the night (or we will teach him to when he is old enough!). At this stage we need to create a strong association with going outside. Besides, if you woke up overnight and needed to pee would you be able to go back to sleep until morning?
If you catch your puppy in the act of having an accident DO NOT PUNISH HIM! This will only teach him that going to the bathroom in front of you is not safe and will encourage him to want to hide from you. In bad weather or overnight this will not be good! Just distract him, scoop him up and take him to his correct potty spot. If he finishes there reward heavily. Then go inside and clean up!
If you find that your puppy had an accident when you were not looking you need to repeat this to yourself, "I was not watching my puppy, I was not watching my puppy". It does no good to show the accident to the puppy and it is NEVER okay to rub their noses in it. They have no memory for those things. They may understand that you don't like poop on the floor, but they have no idea they put it there. It is your job to prevent mistakes, not theirs!
Make sure to feed your puppy on a schedule. What goes in must come out and if we create a schedule we are better able to predict when! When choosing a good puppy food, look for one without cheap fillers like corn, rice and wheat. If these are among the first ingredients of a dog food, keep looking. Dogs do not digest these items well and you will see the results in higher stool volume, as well as coat, skin and ear problems. Avoid foods you can find in the grocery store.
Clean all accidents with an enzymatic based cleaner to really remove odors. Products such as "Nature's Miracle" are great for this and readily available at most pet supply stores and vets. Using a black light can help highlight areas you may have missed.
If your puppy continues to have many accidents despite careful management and following the above suggestions, consider having him examined by a veterinarian to rule out a urinary tract infection or parasite. It is not good to keep trying to modify behavior when there is a medical cause.