First someone needs to take him to the vet to rule out any health problems. Sometimes when a dog starts this bad habit their are missing something in their diet. And sometimes it can be a bad habit which is called Coprophagy. You can get stuff to apply to his food that makes his stool unappealing.
These are just few things that help stop stooling eating.
Dr.Foster and Smith- For-Bid and Dis-Taste
Solid Gold- S.E.P. (Stop Eating Poop)