Do go to the doctor as he could be constipated even though he still poos, this is similar to my DS and turned out he was and needed some medicine to help him go more easily. Also don't panic about school as it still a long way off and you will be surprised how much he improves by September. And a few accidents always happen at school - my son did that too and even though it feels awful at the time other kids forget quickly!
DS is 3.10. Started toilet training last September and it took him a few months but now he is pretty much reliably dry. However, he won't stop soiling himself and I'm at my wits end. He's due to start school in September and I don't want him being teased or left in dirty pants if it happens. Sometimes he tells me he needs to go and gets there on time. Other times he just says 'mum I've pooed in my pants' and waits for me to tell him to get into the toilet.
I'm going to make a Drs appointment although he doesn't seem constipated. Does anyone have any ideas what this might be?