I've been where you are OP and it took me 17 years to find the courage to leave.
17 years of constant flirting which became emotional affairs, he had no end of counselling and promised to change and he did change for about 4 or 5 months each time until he reverted to type.
It was almost like a cat and mouse game, how long before he was caught.
My husband started in our first year of marriage, i should have walked then but he had depression and threatened to kill himself so i stayed time and time again.
When i ended our marriage he thought it was a temporary punishment and I'd let him back eventually, 18 months later when he realised i was seeing someone he realised i was serious and it wss no punishment.
He told me he did all the flirting and enotional affairs for an ego boost and it made him feel wanted and he was never going to leave me for any of them and basically expected me to put up and shut up.
He also told me that when i found out and went mad at him he took it as a sign i did love and care about him.
How fucked up is that? We actually had a really good relationship before he started the flirting and our sex life was good but that wasnt enough for his ego - he needed drama and excitement.
I'm 2.5years down the line from splitting, divorce all finalised, I'm the happiest I've ever been while he sits in a little house all alone on benefits wallowing in self pity.
I should have sympathy as he had a crap upbringing which led to depression but i have no sympathy, he had plenty of chances to get help with his counselling but each time he was never cured because being a dick isnt curable.
I'm glad i got out when i did, i had no self esteem and no confidence when i left him.
His flirting and emotional affairs affected me more than i realised and actually i did nothing wrong (except stay) but the brain doesnt see it like that unfortunately.
By all means let him have counselling and you should too but dont expect miracles and also please take a step back, you do not need to fix him, he needs to fix himself.
Good luck