One thing it could be is nerve damage or even absence (can't remember the medical term right now). Runs in my fam, and we suspect that's what's wrong with my daughter (had problems until almost the age of your son). She simply can't tell when she needs to go, so she has to make an effort regularly to avoid getting backed up.
The way we solved hers is to have her poop every night, without fail, after dinner (she usually had accidents at night while asleep). She would earn a treat if she did. This was after years of trying literally everything to fix problem. Worked beautifully! Of course, we had to make sure she had plenty of fiber, water, etc so it would be easy for her, and she does still have trouble with constipation on occasion. We don't usually let her skip more than a day since she gets constipated so quickly when she does -- sometimes she says she can't go without really trying because she wants to do something else instead. If it's been more than a day, I usually send her back to try again, and if it's been more than two days, she HAS to go before she can do anything else. It always works.
It took until my daughter was a little older to really "get" the whole process. She was on miralax for a long while to help with the constipation but that would sometimes make the encoparesis worse, since she still wasn't making an effort to go (and couldn't tell how badly she needed to -- she really didn't know until she'd had an accident). Now that she understands the issue, it's so much easier.
And yes, it was extremely difficult at first with the fears of it hurting from the constipation. Took a few months of coaching and coaxing and tears, but it was worth it! Once we got past that part and she realized there was no pain when she went every day, it was relatively smooth sailing. She has accidents rarely, usually due to her skipping days without telling or (one time) due to antibiotics.
Don't know if this will help but figured it was worth mentioning just in case. Good luck! I know how incredibly frustrating it is!
(Also, ADD/ADHD runs in my fam too, and she's shown signs of it -- wonder what kind of correlation there is? Interesting.)