Maybe the plants had previously been pee'd on by cats or dogs while outside. ???
I've heard you can put down sticky tape in front of the plants (two sided sticky tape).
Also, clean the area well and spray with something to mask the already-there pee smell, then start feeding the dog in that spot.
how old is the dog ? I assume intact ? i'd just correct him if I caught him …….. doesn't need to be more than a no that startles and stops him , to hard of corrections does nothing but distract the dog from what he was corrected for , they then haven't a clue what they were corrected for ……. as said removing the smell as best as possible is a good idea , it's pretty much impossible to remove that smell to a point a dog can't smell it ……… they all can learn it's wrong , but sometimes an intact dog will get excited and they won't be able to help it , it like a reflex to a stimulus .………. neuter absolutely helps , but if it's gotten to be a habit even then it takes time and corrections ……. consistent , fair and appropriate corrections always works …….