He is trying to communicate with you. If you “obey” him when he bites, he’s being successful and he will most likely repeat the behavior. This is how learning works. Animals and humans try various things to get what they want, and if one method works, this method will be used.
He nudges you for pets -that doesn’t work, so he progresses to nipping/biting. If you pet him in response to a bite, he will learn that biting is the way to get pet. He can’t see the absurdity in asking for pets by biting, because he’s a rabbit.
As for when you’re trying to get him back into his cage, you could perhaps wear gloves for a while, until he’s realized that biting is not going to get him more playtime.
You don’t need to punish him (rabbits don’t respond well to punishment anyway), just teach him that biting won’t lead to him getting his will. You can say “no” in a calm but firm voice, but don’t yell.
This seems more like a communication issue than anything else.