I know of one definite way is to spread red pepper and cayenne across your yard. My parents used to do that when they had the same problem. Dogs have such keen senses of smell that they will avoid your yard as if it had the plague on it. It is also a much safer and natural animal repellent.
There are sprays available to spray on your lawn to drive dogs away. You don't have to spray the whole yard but simply a 5 foot strip where dogs would enter your yard. This keeps the cost down till your neighbors dogs get the message to leave you alone.
The best way to stop a dog pooping inthe yard can be done by practice.You must make sure that the dog must be taken out for a walk out of the yard right after its meal.It would smell the ground for sometime then poops out.Doing this regularly prevents your dog from pooping in the yard.