There are many reasons a dog eats its own poop. Some are learned and some are instinct left over from their heritage as scavengers. Poop eating is called coprophagia.
Sometimes they learn it while still with their mommy. Mommy dogs are diligent about keeping their pups and the pups’ bedding clean. The mommy dog will often times eat the pup’s excrement and then lick the pup clean. Mommy dogs are wired for this as an instinct to keep the den clean to protect their pups from predators. If one pup sees mom doing this and then starts to mimic the behavior, another pup may see it and follow suit. This behavior can very quickly become habit.
Sometimes it happens because of improper potty training early on. If a dog gets its nose rubbed in the poop and is punished or admonished severely for pooping in the house and the owner scoops up the poop quickly, the dog learns that pooping is bad and they must make it disappear quickly, so they dispose of the evidence of this “crime.”
In this case, a good course of action would be to take the dog out to potty on leash and have a treat with you. As soon as the dog potty’s, lead them away while praising them “good potty!” Praising and having a “puppy party” will reinforce your teaching them that they did “good.” Take the dog back inside and then go clean up the poop. You don’t want to the dog to see you clean up the poop because you are trying to “un-teach” them that the poop must disappear immediately. The real key here is to teach your dog that going potty is a good thing and doing it outside is a good thing and they are in no way in trouble for it.
If your dog is randomly eating poop out in the yard, one of the best ways to stop it is find the poop in the yard and and cover it with a hot sauce, such as Habanero. That will be uncomfortable to eat but cause no real damage. After a bite or two, most dogs will decide it isn’t worth it.
If the habit starts suddenly, get a vet check. It could be a health issue. Remember, you always want to rule out any health reasons for any new, negative or odd behavior that starts suddenly.
It is also interesting to note that if your dog suddenly starts to eat your other dog’s poop, your other dog may not be feeling well and may need a vet check. Dogs are wired to protect their pack and will sometimes eat the poop of a sick pack mate to protect it from predators who can smell the sickness and perceive the other dog as being a weak target. Another hard wire left over from their wild days.