Whenever you notice your dog starting to find a place to go to the bathroom in the house always stop them beforehand and take them outside right away.
Keep doing this and tell them that they need to go outside to use the bathroom.
When you see the dog start to pee or poop in the house you tell them NO "sternly" and redirect them to the outside to potty.
It might take awhile but eventually your dog should realize that he/she will get into trouble for urinating or pooping in the house.