@Gabriela He is 3. He is also not afraid of the toilet so idk what it is
The same thing happened with my son. He used to poop in the toilet and then we went on a week long trip where I put him in diapers on the flight and hotels (just to be safe) - that was a big mistake as he just stopped pooping in the toilet. We tried everything but he would hold it and then poop in his pants but not the toilet. This went on for 3-4 months. Finally, we went to a friend’s place where he saw kids his age using the toilet - they coached him and he has been using the toilet ever since.
@Isha oh yes, my son still wears pull ups at night. I usually put them on when he falls asleep. Maybe that's it. Hopefully he starts going again. Thank you for your comment, it really helped ease my mind.
How old is he?