Toilet Training
In addition to the method described below, another thing you should do if it is a new dog or a puppy is to restrict access to what area of the house the dog is allowed to be in. Never give your dog unlimited open access to the whole house. This will often freak them out and encourage them to mark their territory.
Remember, freedom is earned, not granted. Slowly give more and more access to the house as the dog becomes more familiar with your house.