The first step on how to keep dogs from pooping in your yard is to prevent them from coming on the onset. The food scraps you keep in your garbage bins will attract those dogs. Once they get a whiff of the food, theyll come running, eating, and eventually, pooping. To address this, make sure your garbage bins are closed shut every time.