elikapeka
Has he been neutered? If not, get him fixed right away.
The next thing is to get him to the vet for a checkup for possible urinary tract infection or crystals which can block the urethra. Either condition can be painful and cause litter box avoidance, and crystals can be life threatening if your cat blocks completely.
Once you’ve ruled out anything medical, then yes, it’s probably behavioral and stress related. Extra attention is good, as is trying the Feliway – you can also try a litter called CatAttract. It’s very expensive, so just spread a layer on top of your regular litter and that may help your kitty. If all else fails, we successfully stopped spraying and inappropriate urination with Prozac (for the cat, not the humans.) :-) It wouldn’t be the first thing on my list, but it’s the only thing that helped one of our psycho kitties.