A bit fussy to do, but an electric varmint fence unit plus a moist pad he'd have to stand on to pee would be a very real disincentive. Next time, a small female dog might be a better choice.
The easy way would be to get a couple of 'scat mats' from Amazon and put them in front of the speakers. They come in two forms - one just makes loud shrill noises if an animal steps on them and the other actually delivers a shock to them.
Search "electric no pee mat for dog" on amazon