Has he gone to the pediatrician? I would ask for a referral to a regional Children's Hospital. There he could be seen at the Child Development Department where he would be evaluated by a child neuropsychologist, a child psychiatrist, social worker, etc. Was this issue addressed when he was younger? Did he used to have more normal toileting habits, and did he regress? If so, when did that happened, and what was going on then? Has he received any mental health diagnoses? Are there stressful things happening in his family? What has school personnel said?
I think what needs to happen first, is to figure out what is going on. There are a variety things this could be, all very different. And depending upon what it is, different interventions and treatments would be in order.