All this messaging other women and instagram flirting and trying to keep his ex on the hook - this is all about attention and ego boosts and drama.
He enjoys all the secrecy and sneaking around - it gives him a charge. But after a bit, that gets dull, so he engineers a situation in which you find out - he gets sloppy about hiding it, leaves his phone lying around, or starts to mess around with a woman who he knows will make sure it gets back to you (see note). And BOOM - more drama and excitement and attention. You are devastated, you rage and cry and destroy his stuff, you demonstrate your hurt to him in ways that make him feel like the centre of the fucking world. You boot him out and say he has broken your heart.
Then phase three - the winning you back. He will beg, claim he has changed, woo you with flowers and gifts and do all the things you wished he would do when you were together. After all, what could be more flattering to his ego than to win over a woman who he has already treated like garbage? He must be pretty hot stuff, no? You will want to believe his promises so much that you take him back, and then you guys enjoy a blissful few weeks or months of honeymoon period, charged with passion and emotion.
Then he gets bored and starts messaging other women.
Note: After this cycle has played out a few times, he no longer has to engineer ways for you to find out - you will be so suspicious and paranoid that you check everything all the time and never relax for an instant.
Just chuck this one back, OP. He may change - in twenty years when he can no longer get women's attention so easily, he may pick one particularly submissive/eager/naive man-pleaser and let her "win" the golden prize in exchange for the rest of her life spent picking up his socks and taking care of his old-man issues. Don't be her.