I am sorry to hear that you are suffering from unrequited love. This is one of the most painful experiences in life. I think your pain is all the greater because you are so close to your love and see him every day. I can't help but wonder why you encouraged him to date this other girl. Were you thinking that he would never be your boyfriend anyway, so why not encourage him to date someone else?
It feels like you live with a sense of defeat. . . and that when you encouraged him to date the other girl, I sense that you did so because you felt hopeless to win his love. Then, while he was dating her, you declared your love for him. When he refused you, your sense of defeat heightened.
I wonder where your feeling that you can't ever be loved by the one you love began? Did you feel unloved or unwanted as a kid? If so, your unconscious mind would feel defeated, hopeless and unworthy of love. To heal yourself and your broken heart, please find out where this feeling comes from. Watch how your mind unconsciously may arrange to keep you feeling this way (we all are creatures of habit and will keep ourselves in familiar pain).
Watch how you may drive love away so that you can feel even more hopeless (again familiar pain). If you are ready to break this pattern. Then, I would take an active stand with this guy. I would not act defeated, I would tell him one more time that you are interested in being his girlfriend. If he says again that it won't work, ask him why he is so sure, and make him explain his doubts. If he seems too firm to budge, then I would stop putting so much energy into a relationship that makes you feel so heartbroken and defeated.
I spend more time with other people, including other guys. Hanging around exclusively with someone that isn't interested in you will only make you more desperate and defeated, and it will also strengthen this feeling inside you that you can't have the love you desire. Your self-esteem will drop lower, you will feel more depressed and undeserving, and your chances of receiving another love down the road will be diminished.
So, be active and, if you don't get the response you wish, then put more energy into other, more fulfilling friendships and relationships. No one is supposed to be in a relationship that feels emotionally depriving and diminishing to the self. Your love should be returned with equal enthusiasm. All the best to you.