Just a thought - perhaps the Spirit Essences from Jackson Galaxy may work?
I agree with others that it sounds like a stress response- perhaps to cats outside the house? He apparently knows how to use the box, but something is making him act out....
I've had great luck with the Jackson Galaxy essences.
One last thought: many years ago i had a kitten (7 month old Abyssinian) who would use the box when i was not home, and then in front of me, would pee on my bed, carpets, etc. I was at my wits end.... The vet suggested i change litters, and voila- it seemed to cure him of the habit. I'm sure you've already tried this...but just wanted to mention.
Best of luck. I know the situation is trying and heart breaking.