S.H.
Does he have any stress? Any problems? Any changes in his life? Any issues with school/friends/teachers/adults?
Usually "regression" in a child is an indication of 'stress' or of them being unable to 'cope' with something. It is emotion based.
Or, it can be a medical problem, like constipation and/or "encopresis." (look it up online). Or a bladder/urinary infection.
These things are involuntary. They cannot control it.
Try talking with him..... just in a comforting way... and see if anything is bothering him... etc.
But the main thing is don't make him feel 'weird' about it or that he is upsetting you. Because a kid, doesn't do it because it is fun or that they like it.
Try taking him to the Doctor as well, to rule anything out.
But I would... see if there is anything, in his life, that perhaps causing it.
take care and all the best,
Susan