Accept it: When you come to know that the one you love doesn't thinks the same way for you, the best thing to do is to accept it. You cannot force him to love you but you can accept it and move on! Even though it is difficult to accept this fact and move on in life, but trust me this is the best way. If you have tried other means to get his attention towards you, and it didn't work, let him go!
Avoid being along with him: If he wants to be just friends with you, avoid hanging out alone with him. And if you do, then take your mutual friends along. This will make both of you comfortable in each other's company.
Divert: When he wants to be just friends with you, you have to divert your mind from him. Thinking about him will only sadden you. The same thought within you will also build a stubborn nature. To have a healthy life, divert your mind in something you like (except him). For example, some sport you like, music, friend circle or book can be your best friend when you face rejection.
Never discuss again: When he has said that he only wants you as friends, it is best to leave the topic then and there itself. If you two are friends then, do not discuss about the feelings every now and then. This will only make him uncomfortable and gradually take him far away from you. He might feels that being friends can be troublesome for both. So, behave normal and pretend that you have moved on! If he picks up the discussion, be free to interact.
These are few things to follow if he wants to be 'just friends' with you.