So sorry you are here, dear. This is a wonderful place full of good advice, but let me give you one caveat in your sitch.
I don't think your H is the typical WAS (as in normally good guy who just succumbs to a flirtation during a time of stress or depression). It sounds like your H is a different, rarer breed - a sex addict.
Forget for the moment all the ways he tries to twist this around on you. We all have our faults and things we need to work on, but there is NOTHING you did or didn't do that caused him to engage in this kind of aberrant behavior. This isn't a result of him marrying young, or you being preoccupied with the kids, or anything else. This has to do with HIS issues, his drives, his peculiar thinking. It may be linked with his other addictive, behavior, gambling.
It may be possible for him to get better, but only with intensive therapy and treatment. As long as you cling to him and try to win him back, you're only enabling him and allowing him to cling to the fiction that he's left because of things you did.
I think it's time to be lovingly open and firm with him. He has problems - sex addiction, gambling, depression - and he needs help. Until and unless he gets that help, you need to be separated from him. Financially, for your protection, and physically, for your protection. This man has a dangerous disease that could kill you, because his sex addiction could easily lead to him infecting you with AIDS. Your kids need you to be healthy and whole - and they need him to be healthy too. Ironically, I suspect the best chance he has of getting help is if he hits rock-bottom first by losing you.