Why Does He Say He Really Misses Me, But Doesn't Want Me Back?

Hey Essy, So here's my story...I hope you can offer some advice to help me

I'm seventeen and love this guy with all my heart, we were even each other's first, but a few months ago he said he needed his space. We gave it a week and he ended up breaking up with me. For the longest time he wouldn't talk to me so I ended up going out with another guy for about a month to see how the otehr guy reacted. While I was with the new guy my ex seemed like he was trying to get back together. He said that I shouldn't be this other guy's girlfriend and that he and I should hang out. He also kept bringing up our song. After broke up with the new guy my ex and I hung out and hooked up (no sex of any type though). He told me that he really missed me and he was acting like we were back together, singing out song to me and holding my hand and playing with my hair and even calling me beaufitul. Of course I thought that we were going to get back together but after that day we didn't. We continued talking but as of now we barely speak. I honestly don't know what to do! I really love him with all of my heart and no matter what I do I can't stop thinkinh about him.
Please help me Essy! I am at a loss and need help immeiately. Please reply to me with some advice. Thank you so much.