First you should talk to him and ask him why he didn't let go. This goes one of three ways
1. He didn't know you tapped. This is most likely the case, so learn to tap better; distinctly on their body when possible, with your voice if hands aren't possible, with your feet hard so they hear and can't mistake it when hands and voice are both not possible.
2. He knew you tapped and held the submission anyway because he wanted to for sadistic/bad person reasons: You should talk to the instructor about it so that they're aware and have them deal with it, and you should avoid rolling with them in the future.
3. He knew you tapped and held the submission anyway because you were greenlit and he was teaching you a lesson: this is the least likely possibility, but if you're rolling too hard with smaller people, younger people, or inexperienced people, SOME gyms will send a shark after you to hurt you. It's fucked up if they do this before talking to you about your tendencies, and usually it's just a mauling rather than not letting go of submissions, but it does happen. You should still talk to the instructor even if this is the case to find out how you can not act like a spazz gorilla.