Need to really P!$$ them off so they go elsewhere
I've had this problem too despite having a male dog who's mates also come and pee in our garden. The foxes have been living & breeding in next doors garden coming and going via our garden. Too many next door now so they've been trying to dig homes in our garden.
you have to do multiple things at the same, i started with solar charged flash and ultrasonics which failed quickly, solar charged flashing red lights, then other solar garden lights, then pir solar lights, then wind spinners, then solar garden flowers, fence spikes, then Scoot diluted in a 10l water sprayer, hand pumped so sprays almost a mist for good coverage. Then make your garden ingress fox proof. Amazon has a great selection of the above deterrents.
The thing that worked the best though was Scoot diluted in the spray pump. really stopped the fouling and the spraying they where doing. The worst thing is waking in the morning and smelling fox wee and seeing fouling on your doorstep, then having the same when you come home after work.