I agree with twodawgs - this depends on whether it's a puppy you are training or an adult dog. If the dog is adult then is it new to your home and/or does it have any current medical conditons?
If it is just a puppy or an older dog needing house trained then it is usually qite simple, since a dog's natural instinct is not to mess in the 'den'/home but go outside. So basically just work on this angle. Praise the puppy/dog whenever he does the toilet in the right place. If the dog messes in the wrong place, never punish or scold the dog - just ignore it and ignore the dog for about 5 minutes. Then quietly clean it up without saying anything or interacting with the puppy/dog. They very soon come to realise where they are suppose to do the toilet. It is also much easier if you already have another dog, since a new one usually just copies them.
If there are other issues such as a medical reason, then speak to your vet. If it's something such as anxiety then a behaviourist is usually very good and very quick at sorting out these problems.