There is actually a technical term for dogs that eat their own fecal matter and this is called Coprophagia. It is common and the first step in correcting the behavior is in understanding why it happens and there could be several reasons. If a dog is underfed or being given a poor quality dog food this behavior could develop. Being hungry or malnourished could cause him to eat things in addition to his regular diet, such as his own stool. Also if a dog is eating too many treats he may be too full to complete his balanced diet leading to irregular eating habits including increased appetite at varying times of the day. When this happens the stool may be the only thing available.
A dog may have a medical problem that causes a decrease in the absorption of nutrients or causes a gastrointestinal upset so he may resort to eating stool.
Stool eating also occurs if a dog is bored and does not have anything else to stimulate him. He may investigate and taste out of boredom. Also if a dog is kept in a space too small such as a crate or play area he may become stressed if feces gather in the area and are not cleaned up quickly or properly. This can happen in a large space as well!
Feed your dog a well-balanced meal with a high-quality dog food or home cooked selections on a regular schedule. Keep his living space clean, full of toys with lots of room to move around. The final solution when all else fails, seek advise from your veterinarian to determine a medical cause.