That sounds EXACTLY like encopresis. You need to take him to your ped ASAP but then also to a pediatric GI. Most peds are pretty clueless about this. It's a very common condition, especially in boys ages 5-10, but most people have never heard of it because it always gets misdiagnosed (aka lazy boy). It's a legitimate medical issue. He has no control over his bowels at this point.
Basically, he got constipated, the stool got backed up and now loose stools are flowing around the backed up stool. He's lost all sensation due to being stretched out and no longer has control over the muscles that 'hold it in'.
The standard treatment is an X-ray to determine how much he's constipated. Then 3-5 days of 'cleaning out' which is basically massive doses (like 6 or 7 capfuls a day) of Miralax and/or a few doses of exlax. Then another x-ray to confirm there's no stool left. Then put on a maintance dose of Miralax (1/2 to 2 capfuls a day, depending on your child) for 6-12 months (yes MONTHS) until things get back to normal. During this time, he needs 'timed toilet sits' which basically means he needs to sit down for 10 minutes 10-20 minutes after every meal to take advantage of the bodies natural instinct to poop at that time.
Many people, including pediatricians, seem to think that simply giving a capful or 2 of Miralax a day is sufficient when in most cases it is not. That makes the problem WORSE. It just makes the new stool soft but it's not enough to loosen the mass so it's more likely the newer softer stool will just leak out. As long as the hard mass is in there, it'll never improve.
It's a long battle but like everything else the sooner you catch it the shorter time it takes. My son just turned 6 and we didn't have a diagnosis until he was 5 even though the problems started right after potty training at 3.5. We followed our ped's advice for 9 months before finding out about ped specialists and insisting to see one. We saw no improvement with our ped but after just 1 visit and 4 weeks after seeing the ped GI we saw vast improvement and are now down to one soiling incident (don't call them "accidents"... he can't control it and calling them accidents makes it seem like he can!) a week. It used to be several a day.