And he does that only when he is home , the doctor says he will outgrow it, I feel so sad for him and it's also heavy on my wife and me sometimes.
I had a similar situation and would advise to see if you can get a feel for the environment. Like some people said it could be anxiety. But I would talk to the teacher to see what can be done to address the issue. I would also see if you could shadow the classroom one day to see if you could spot what could be the issue.
https://autismintervention.co.za/
What to do
Consult a doctor: It's essential to rule out medical issues and get professional guidance, especially to treat constipation.
Implement a "potty reset": Go back to basics with your child's potty training. Consider having them go without pants at home for a few days, which can help them become more aware of their body's signals.
Encourage bowel signals: Remind your child to go to the bathroom as soon as they feel the urge, rather than waiting until it's too late.
Focus on diet: A diet rich in fiber and fluids can help prevent constipation.
Provide encouragement: Use positive reinforcement. Avoid scolding, which can increase shame and anxiety.
Make the bathroom accessible: Ensure your child can easily get to and use the toilet by providing a step stool and easily removable clothing.
Keep a diary: Note down when accidents happen to help identify patterns or triggers.
It probably is a different environment and stress. Sometimes kids will do something at home but not at school and vice versa. Don't give up hope though.
You have to speak to the teacher about helping him
If your teacher can help it would really benefit your son
I think he's seeing other kids in class being cleaned or nappy changing so he thinks it's normal. That's my guess