We went through the same problem last year with my son who was almost 6 at the time and most of the accidents were poopy accidents. His peeing accidents were usually at night since he is a heavy sleeper. As to the pooping accidents, we thought he was just being lazy since we didn't think he was constipated (pretty regular every day). But, the doctor ordered an xray anyways and we found out he was a little blocked in one section of the intestines, but a little still came out every day, which is why we didn't think he was constipated. He got laxatives for several weeks which helped tremendously. He has also been getting probiotics every day since then to keep his intestines healthy. Once in a blue moon, he has an accident and it is really pure laziness. This was also the reason for his peeing accidents 2 years ago and the teachers made sure to remind him to go before any he start any activity that he liked.
I would definitely make sure to remind him more often and get his teachers on board, too. Don't scold or reprimand because it just may be something he just can't control. If the reminders still don't work, then talk to the pediatrician of your options.