I need advice I’m so confused and need help

Long story.

For a couple of months I’ve been having a gut feeling that my bf of 5 yrs is hiding something and being secretive. For the last couple of months since our fall semester started I felt as if we were growing closer and closer. Around the months of nov and dec is when things were off with him. He’d be really picky about when I could use his phone (as a camera bc his quality is fire asf lol or for music bc I don’t hve Apple Music lol :( ) Any way, about two ish weeks ok I woke up with a gut feeling that something is up. So, knowing he’d be gone for half the day , went through his laptop. Y’all know how it is with iPhones and macs: the messages/pics sync on there so of course I go to messages. I don’t see anything off and mind you I DONT CARE IF HE HAS FEMALE FRIENDS obvi we are allowed to bc one we are grown and two it’s not realistically possible especially in our career fields. The only thing I ask is that he makes it known he as a gf and set boundaries. So there was one female who’s name looked super familiar. Turns out I was right and it was someone that he talked to while we took a break on our relationship. Bc we were 3hrs away plus add on college our relationship was strained for a couple months. We were up front on who and what we did bc nowadays you can never be too careful and for both of our health etc. Like I said it was a girl he used to mess with in his messages. AGAIN mind you. There have been multiple occasions where I have made it clear that it’s disrespectful to still talk to people you messed with while with me and he agreed. Of course off rip I was pissed to see that the same girl he “blocked” on social media as well as “deleted” her number was once again in our life. As I’m reading through it’s very flirtatious and to my surprise initiated by HIM. The convo was basically them trying to meet up in our hometown during our winter break while I’m at my parents missing tf out of him. They never met up bc of the girl leaving for her home town early..There was also a time where she asked about me and and brushed it off by saying that him and I are “cool, but any way do you have a bf👀” At that point I’d lost it! I was PISSED. So of course I confronted and went tf off. I feel betrayed and hurt. His explanation as to why he even initiated anything was to “ see if I still got it” as in to see if he could still pull girls. I mean obviously he’s still got charm if I’m STILL WITH HIM ??? So for now I broke things off and labeled us as friends working on things. I mean how was I supposed to know that our 5 yr thing was going to be disturbed in this manner? I love him so much and I consider him my best friend. But I’m very hurt. He’s still staying with me bc my anxiety is bad and I can’t sleep alone now. And we’ve also been intimate but made it clear we aren’t a couple rn. Idk what to do. My love is strong for him and I’m hurt at the same time. He’s apologized more than once but I need action. But literally what action would I even be looking for? You know what I mean?

Really would appreciate advice , outside perspective helps.