Head in single leg takedown above the knee – bad idea. If they are kneeling in this position, turn to face the same way as them, pinch legs together, and kick the leg closest to their head to break their grip. From this point can transition to crusifix etc.
For the head outside single leg from kneeling, grab their foot and bend it up into their butt, twisting it adds effectiveness here. This prevents their takedown.
Halfguard pass. From half guard top chest to chest, elbow next to their head, free leg sprawled out with no knee touching, out wide way up as high as their head. If they are on their side, walk the trapped leg up into their butt. This will allow the trapped leg to pass to mount. If they block the pass with their hand on your knee, then can underhook their arm, and slide the trapped leg really low into side control. During the transition to side control, maintain the underhook and with your free arm overhook their free arm for a really tight side control, can put all weight on them with only feet touching the ground, lifting the underhook arm off the ground. Can then step over their head for an armbar.