Welcome to Knitting Help!
To do the legs, you'll have 20 sts on the needle. Knit across 10sts, turn as you would at the end of a row and knit back on those same 10 sts. Leave the other unworked sts for now. Finish knitting the length you need for the leg by continuing to knit back and forth on the same 10sts and then bind off. Now take a new end of yarn and start knitting the sts that were left on the needle back when you started the legs. Knit those 10 to the required length and bind off.