Ideally, dogs should be trained to urinate and defecate on command and in an appropriate place. Use of an outdoor area is advised as those used to using newspaper or puppy pads in the home indicate to the dog that it is acceptable to soil indoors and thus will be a difficult habit to break.
Never use physical punishment when a dog goes to the toilet in the wrong place. This will just make the dog more secretive and difficult to housetrain. If you find a mess that your dog has done earlier, you must not punish your dog, even verbally.
Mistakes will happen, and your dog will occasionally soil in the house until he is fully housetrained.
Dogs tend to need to go to the toilet within 20 minutes of a meal or a period of sleep. You should take your dog to the toilet area at these times, and regularly every 90 minutes during the day [every 60 minutes for puppies] until you can see a pattern to when your dog needs to go to the toilet.
Designate a toilet place in the garden. It should be an obvious place, preferably somewhere that your dog has previously used. If you have to mop up urine in the house then wring out onto this toilet spot so that it is marked as a latrine.
If your dog does not go to the toilet, silently lead him back inside without even taking the lead off. Try taking your dog outside again a little later.
As you repeat this training you will find that your dog rapidly comes to understand that he should go to the toilet whenever let into the garden or given a command. You can test this by following the same housetraining routine when you go for a walk.
It is also important to restrict your dog’s ability to make mistakes. Keep your dog supervised at all times when you are at home and take him to go to the toilet before you go out. Look out for circling or scratching at the door. Also consider using an indoor crate to confine your dog while you are out. Dogs will rarely soil their own bed area so this prevents accidents while you are not around. Dogs will learn to ignore immediate urge to urinate when in a crate and this will be useful at night. You will need to relieve young puppies during the night or early morning; however you set a time to go to them when they are quiet in their crate.
A normal dog may take 3-4 weeks to become reasonably well housetrained, but a dog that has grown up without any training, or that has been incorrectly trained using punishment may take longer to learn.