They escaped by making a spear and stabbing the cyclops in the eye so he could no longer see. Also then when the cyclops moved the boulder to get out of his cave, he felt all the sheep to make sure the men weren't escaping. So they grabbed on to the bottom of the sheep so he didn't know they were escaping.