How to escape (and avoid) a Schoolyard Bully Headlock (side headlock) against a far bigger and stronger opponent?

Yesterday I tried testing myself and grappled with a untrained friend who is way bigger than me (138lb of pure muscle vs 190lb of pure muscle, we are both 5'8). He got me in a side headlock and was holding me there for about 2-3 minutes, I managed to get out but he got me in it again 40 seconds later and he held me for about 2 minutes as well. I eventually got out and since he was too tired I easily got him in a RNC, but it made me realize how vulnerable I am to a bigger stronger opponent.

I'm a 1 year white belt but have never learned the proper way of getting out of a headlock, I always just try to just be patient and wiggle out slowly.
Edit: 1 year white belt but the first 9 months was kinda on and off since my main sport was football/soccer, but after injuring my knee again I decided to fully focus on jiujitsu