Have you considered a tether so your dog cannot reach your flowers?You could walk your dog, great exercise for both of you.
Joan...My suggestion is to have you son with the dog on a leash and take it to the proper place to do his business. Hopefully he will then learn where to go. Good luck
Training and motion sensor sprinkler
Unless the dog is trainer not to pee there he will continue to do so.
Time to start training! I taught all my dogs where they welcome to do their business. Not that hard, but it does take time and patience. Lots of on line tutorials. Here are a few sites to get you started.
Dogs tend to avoid citrus scents, or oil of rue. Try spraying the area with the scents, mixed with a few drops of lemon scented dish detergent in water, which increases "sticking power". Dogs will also tend to avoid areas interplanted with strongly aromatic plants such as marigolds, lemon balm, rosemary, rue, basil, etc.
Dig up the plants?