Was his litter box cleaned. Cause some cats won't go in a dirty box. I have two litter boxes cause my Mooky who is 10 months old now, would not do his duties in the litter box if my Katie girl, who is 11 years old, had a poops in it, so he would use the other one. Maybe if you have the room for it, you can try putting another litter box and see if that helps.
But if he continues to do this than i would bring him to a vet to make sure it isn't a medical problem.
Good luck and keep us posted.