Immediately after feeding the dog, walk it until it pees. Also walk the dog when it first wakes up. Praise the dog with treats when it urinates outside.
If you can catch the dog in the act isolate him for 5–10 mins in a room with no people or toys. This type of punishment is very effective for social animals and will promote a healthy relationship between you and your pet.