
The only reliable method (unless you supervise each and every trip outside) is to partition off the part of the Garden they are to use.
I wouldn't expect a sandpit to work as they are not like cats that choose to bury their waste. Given a choice most dogs want to use grass, or if always kept on concrete a concrete or paved area.
My friends have recently increased the size of the area the dogs hafve access to, and all that has happened is they have more area to patrol on pick up duty.
I have the first 20 foot of the garden partioned off for the dogs, in which is a grass area that they most often use. so they probably use about half the available are to poo in, and each has a favourite spot to wee, but pooing seems to be more random.