Complicated...

For a while, I've had a string of 'bad luck' with guys. For one, it's almost been a year since I broke up with someone I've been in a 'relationship' with since 2013. I put the quotes on relationship because there was no love, only passion. Plus, this person guilted me into staying when I tried to break up with him prior. (He's younger than me and it was long distance.)
After him, I made the mistake of jumping into another relationship. I couldn't trust him completely and I would oftentimes get emotional whenever we talked about that issue. After a few weeks, he decided it was best for us to 'take a break' so I can work on myself.
When he saw how well I was doing, he would say things to make me feel bad about it. You could say it was manipulative. After I told him I could finally trust him, he called it quits on me. I was devastated. After that, we never spoke again. (This person was often more focused on his video games than me. It was long distance as well, but this time he was older than me.)
It's now almost been a year and I've developed feelings for someone in a group of friends I hang out with. Over the past 2 months, there have been days where he and I would sometimes talk and sort of flirt with each other then he would behave cold as in not talking to me or even look at me the next day. (He's aware of my feelings for him.)
A friend of mine asked him why he wouldn't give me a chance. He told him he doesn't want a relationship and is trying to get over his feelings he had for a friend he knew for YEARS, so 'it's not me.' I tried to act I was fine with it.
It was recently that I've noticed he would flirt with a female friend of his who's in the group. He would hug her from behind, wrap his arm around her, etc. She would flirt with him back in the same manner. When I see them like that, it makes me sick to my stomach and makes me feel and think it's something I'll never get a chance at with him.
I have friends, especially my mom, saying I could do better.
What can I do?