First, don't think that you are being mean to your dog by training him or
her. Dogs are pack animals by nature. They need to belong to a pack. When your
dog became part of your household your dog became part of your pack.
That makes you the Alpha Dog - the Leader of your pack.
Your dog wants you to be the leader. Your dog wants to know that there is a strong Alpha Dog giving orders and keeping the pack in line.
The very first thing you need to do as the leader of your pack is to housebreak your dog. In the wild, dogs (wolves) are trained early not to do their business in the pack's den, and it is vital that you train your dog not to do its business in your den (your house).
Most dog experts agree that the best age to housebreak a puppy is between 8 and 12 weeks old.
If you are housebreaking a puppy, one of the best ways is to use a crate. Believe it or not, puppies like crate training. For a dog a crate is like its ancestral den and the confined space in a crate gives your puppy a sense of security and safety.
NEVER use the crate to punish your puppy. The crate is NOT a jail. Your puppy's crate is its happy and safe home. Never lock a young puppy in a crate for more than 2 hours - three hours tops in an emergency.
Puppies won't make a mess in their sleeping area unless you leave them locked up for too long at a time, which is why the crate makes such a good tool for housebreaking. Leave your puppy in its crate for two hours and then take it out of its crate and lead it outside to the area where you want it to do its mess.
As it does its mess say the words "Hurry Up" and then praise your puppy, possibly even give your puppy a small treat on occasion. By using the words "Hurry Up" as your puppy is doing its business you train it to associate the words "Hurry Up" with doing its business. Later, especially on cold, dark winter nights you'll appreciate the fact that the words "Hurry Up" will shorten your "walk" time considerably!
Always take your puppy out the same door and to the same area each time. This will teach your puppy to scratch at the same door when it needs to go out and it will make your future clean ups quicker and easier.
Try to take your dog outside to do its business at the same time each day. Dogs, like most humans, feel most comfortable when they have a routine to follow.
Unless you catch your dog in the act of making a mess, do NOT scold your dog for making a mess in the house. Rubbing your dog's nose in a puddle of pee even a few minutes after the act does NOT teach your dog not to pee in the house - it only CONFUSES your dog.
If you CATCH your dog IN THE ACT of making a mess in the house grab the dog's collar and yank on it, saying the word "NO!" in a DEEP and STERN voice and then lead your dog to the outside area where you are training it to go to the bathroom. When your dog does its business, praise your dog (and don't forget to use the words "Hurry Up" as it is doing its business).
If your puppy is running around the house free keep an eye on it and learn to recognize the signs when it is about to make a mess. It might start circling an area, or it might start sniffing its nose close to the floor, or it may begin walking in a different way. Almost all dogs give some kind of a signal before they are going to mess. Learn to pick up on your dog's signal and then pull them by the collar to the outdoor area where you want them to go.
You're going to have to be a little patient. Your puppy will have accidents. Your puppy, after all, still has puppy-brains and it will take a certain amount of time before the neurons begin to click in that little brain and the light bulb suddenly lights up and your puppy says "Oh, that's what you want me to do!"