Oh, dear heart, I have disappointing news. I know you have a crush on him, but it's one-way. Although you've seemed to have good chemistry and flirted in the past, you've either misread the situation OR he is leading you on. Perhaps it' both. Whatever the case, he is telling you he does not like you as a boyfriend/girlfriend, only as a friend. As much as that disappoints you, you must respect his answer and turn your attention elsewhere. If you persist, you will lose his friendship and some of your self-respect.
Let me use a food analogy to help you process the feelings of rejection. Some people don't like chocolate cake, as wonderful as chocolate cake is. You can't make them like it, cannot blame them for not liking it, and can't force them to like chocolate cake. It's just not their thing. But there's nothing wrong with that chocolate cake and someone else will certainly enjoy it. You're that perfectly wonderful piece of chocolate cake. This is his loss. I'm sorry.