Take the dog outside every 2 hours, also let the dog know you are upset with him when they go in the house. Dogs always what you to love them so they will feel bad they did it then and stop. Never hit the dog though for going in the house just take them outside and say no. I taught my dog to let me know when she has to go out by ringing a bell I put around the door we use to put her outside worked great!
Take him outside frequently also, if he marks his territory (In the house) you must make him/her understand its wrong, (don't hurt it though just like make a tone in your voice as if your unhappy and show it what it did wrong) also praise it when it uses the bathroom outside :)
What my family did / and it worked perfectly : Buy tasty dog treats!( a good brand that won't upset his stomach! Lol no one likes guu'ie poop) then only give it to him when he correctly completes your objective. The dog would get used to the pattern and then would automatically do what he needs to do over time and await for a treat. Make sure to let him out evey 2 or so hours depending on the size of the dog , maybe before breakfest, lunch, snack, then dinner and before bed. Make sure to watch his behavior outside an inside, correct him as a n owner!!