To correct a dog's habit of pooping indoors, you need to implement proper potty training. First, understand your dog's elimination schedule. When you notice signs they need to go, guide them to their designated potty spot. Consistent repetition will teach them where they should eliminate. When they go in the right place, provide immediate positive feedback with treats or toys to reinforce the desired behavior.

Why Do Dogs Urinate Indoors?
Dogs may urinate to mark their territory, especially intact male dogs with strong territorial instincts. They may mark to signal that an area belongs to them. Additionally, if a dog hasn't been properly potty trained or if previous training methods were ineffective, they might not understand where they are supposed to relieve themselves and may therefore have accidents indoors.
Methods to Correct Inappropriate Elimination
1. To help your dog learn to eliminate in the designated area, establish a confined potty area. This narrows the scope of where they are allowed to go and prevents accidents around the house, with the bathroom often being a great spot. Provide a pee pad for your dog but ensure the pee pad is not placed next to their sleeping area. Dogs are generally clean animals and don't want to eliminate near where they rest.
2. Once you have the pee pad set up, pay close attention to when your dog needs to go. Usually, dogs will feel the urge to eliminate within fifteen to thirty minutes of eating. Signs they need to go include sniffing around, circling, or squatting. When you observe these signs, immediately guide them to their pee pad so they can eliminate there.