How old is he?
Accidents WILL happen... even in older kids.
Do not punish for it or compare or lecture.
Its okay. They are just kids and learning.
Everyday, will be different.... its normal.
"Knowing" something in their heads, is different than actually being "able" to do it... and every single time. You need to allow for flukes/regressions/mistakes.
A child will NOT be perfect... ever. They can't help it.
Just encourage him. Praise him. Encourage him to "try his best"... NOT about being perfect.
That is too much pressure for a child.
Until he actually "masters" the whole process.... learning also entails mistakes or inability. Its normal. Just like learning math, for a kid.
If a child is not ready for pottying... it WILL take a LONG LONG time. Even a year long.
Next, make sure that he does not develop constipation. Because this is something kids will do, if not "allowed" to poop in a diaper. Constipation... means the child "withholds" their poop and not go. At all. Then, this becomes a bad thing... because as the poop gets harder and more constipated... then it hurts and causes pain when they do poop. So because it "hurts" they won't want to poop at all. This can also then develop into bulging bowels and "encopresis." Bad. This is what happened to my daughter.... we did NOT force pottying on her... but it causes anxiety in a child. We then had to see a Pediatric Gastroenterologist... and he said DO NOT FORCE the child to poop... in a toilet or withhold the diaper or scold them. This will only make it into a battle and an "emotion" based PROBLEM. So then it becomes a medical problem (constipation) and then an emotional problem for the child.
He said, to go according to the child and their cues and ability.
Once constipated.... it takes MONTHS to get their poop to become normal again and for the child to feel okay about pooping. We had to treat our daughter with prescribed things.
Pottying is a process.
Then, "night time" dryness during sleep/naps, is an entirely DIFFERENT process and ability. Night time dryness does not occur until even 7 years old... and this is normal. It is a purely biological ability.
The process is:
1) peeing and mastery of it in a toilet/potty chair and them being able to tell you.. .and then being able to Hold it long enough to get to the toilet... and then be able to pull down their pants/underwear too.
2) pooping in a toilet/potty chair.... and same as above
3) being able to do it on their own... with supervision
4) being able to wipe themselves
5) being able to at-will do all of these things.
6) being able to have bladder control and hold it... on outings and in the car.... or being able to hold it long enough to get to a bathroom if at the mall or something.
7) Night-time dryness... which is a whole different thing.
There are parental expectations of pottying... versus the child's actual ability. And these are often in conflict.
You also need to "accept" that there WILL be accidents. If you get mad... it will make them regress or not want to, or they will get hang ups.
Accidents are normal.
All the best,
Susan