
Get in trouble. Get sent to the office for your own sake. These motherfuckers need to understand violence is violence and there's no "oh he likes you".
Had a teatcher tell me the same shit yours said to you when I was in grade 5, only started to believe when the boy beated me luke crazy and in the end they still said "sometimes ppl bully the ones they love but there has ro be a limit" to the boy.
Go mad lad at your teacher and the kid. Get mad, 'cause if they won't, you will.

I agree with Trxsh and Nickaole, tell someone in a higher position.
I would like to add however, that you should also explain to whomever you decide to talk to that the teacher refused to do anything.
And, if that doesn't work, you shouldn't be worried about following the rules. The idea of "bullying means he likes you" is toxic and shouldn't be expected nontheless accepted in schools. Fight back, and if worse comes to worse, then just get yourself sent to the office. Your first priority should be yourself, not some little douche waffle.
There was this one kid that kept hitting me with his binder, and called me racist stuff(ex:Nazi soldier) and I told the math teacher and guessed what he said...
“I think it’s just a bad attempt at flirting” UM NO THIS AIN’T KINDERGARTEN AND YOU KNOW THAT! THIS STUPID ASS TEACHER DIDN’T EVEN DO ANYTHING BUT HE WILL SEND KIDS TO THE OFFICE FOR TALKING WTF?!?!?! There was also another time, where the same kid who was bothering hit my friend HARD in the neck, and I told the teacher...The math teacher said he was only gonna write that kid up...Um correct me if I’m wrong but isn’t that assault? AND YOU SENT KIDS TO THE OFFICE FOR TALKING! Fucking stupid math teacher doesn’t even do anything helpful. Useless square roots shit I wouldn’t even use in the future but I’ll get in trouble and get sent to the office if I said that