Here’s some techniques you can train for when you have half guard and your opponent has double under-hooks on you.
These are demonstrated on the Submission Master grappling dummy.
First, if you can move to your side and tuck your arms, it can prevent the double underhooks from happening at all, and it allows you to do other techniques like a kimura shoulder lock.
Next, you can brace your forearm against his face, put your other hand to his knee and push away, giving you space to put him into guard position.
If his knee is too high to put your hand on it to push, you can overwrap his arm, grab his ankle (or pant leg) lift him up and over to take top position.
If your opponent bases his hand out for any reason to keep his base, that allows you to take your arm underneath his. You can then go to his back as in the video.
If he has his arms and his knee very high on you, preventing the last technique, you can bridge, bring your arm over head, crunch your elbows down hard, the get double underhooks.
Finally, if you have the flexibility, you can slide your hips to the side, bring your leg over top of his arm, and complete a kimura shoulder lock, wrist lock or straight arm lock.