Press and hold E on your ally to grab him, then drag him toward the ship.
The tricky part is stairs. Keep E held, bring him as close to the step as you can, jump up onto it, then press E again to reposition your grip. Repeat until you reach the ship.