When you spot your dog starting to go pee or poop in the house clap your hands and stop them while saying something such as No, No, not in here you go outside to potty and then take them outside to potty right away.
Don't let the dog come back into the house at all until they actually go pee or poop outside.
Every time your dog starts to go potty in the house stop them before they potty in the house and take the dog outside right away.
Keep doing this and they should eventually learn to wait to go outside or they'll get scolded.
Take your dog outside often as well to prevent them from needing to go potty in the house.
Don't always wait until the dog lets you know they need to go potty before taking them outside. Take the dog outside to potty at least every 2 hours.