Relationship advice

So my first boyfriend broke up with me almost a month ago because he couldn’t figure out how he felt about me. He just realized he has depression, and I have depression too so I wanted to help him (I also didn’t want to leave him then, and when I’m going through a depressive episode I stop feeling emotions). Anyway, while we were breaking up I wasn’t crying and it was a mature conversation, and he wanted to hold my hand, then he hugged me for a really long time. We decided to be friends, and we’ve been trying but it’s been kind of weird for me because I feel like he’s still flirting with me. I don’t know if he regrets breaking up or just doesn’t know how to not flirt while talking to me, but I’m still feeling a spark. He also keeps bringing up a friend of mine, we’ll call him John, and joking about me dating John (even though things are completely platonic), it kind of seems like he’s jealous?

Anyways, I’m having trouble getting over him because I’ve had feelings for him for a while and he’s super sweet. I also have an unstable home life and emotionally abusive parents and he was one of the few people I trusted. He was safe. I don’t know how to get over him, so any tips? Also any ideas about what the hell is going on with him or how to make being friends better/easier?

I’m 18 by the way and I’m a senior in high school