You must accept that it was your friend he was much more into than you, it's hard but the sooner you allow yourself to heal from the hurt the better you will be, and save your heart for someone who truly deserves it by the sound of things he definitely didn't.
He played you /:
I remember in my highschool the 20% of guys tht was like this had 80% of the girls drooling over them ...then after they get played they claim guys aren't crap
I would know about things like this, easy, when guys say they don't want a relationship it means...they just want to get laid. He probably realized you weren't going to put out, your friend seemed more vulnerable or he just moved on to the next target.
Rejection almost always hurts but much better to find out now. Also there are plenty of other fish and you are soo oso young!!! I remember those times in my life. Was crushed and thought that the world would end. A healthy way to get over it is to distract yourself with other interests worthy of your attention...like school work friends tennis whatever you are into that has a positive impact.
He was never into you in the first place, he might have led you on to be nice or just saving you as a back up in case it doesnt work out with the other girl. You got shite on, accept it and find a cuter guy. Gl.