Effectively communicate to him and let him know and understand that you are not interested in him as a boyfriend not even as a friend and tell him to stay away from you. Try hard enough to speak to him with confidence and respect. Avoid hostile and abusive language because that could work against you by making him violent at you.
You could tell him something like: “You are a nice person, and I don’t want to hurt your feelings, but I am not interested.”
Hopefully, he will leave you alone. If he does not, tell a teacher or an adult person to talk to him. It may seem embarrassing to you to talk to the adult person but you have got to stop him as soon as possible otherwise things could get worse.