Hey there!
Odysseus does not stab Polyphemus, the Cyclops, because if he does, he will be trapped in the cave along with some of his men. A boulder is blocking the cave exit, and the Cyclops is the only thing strong enough to move it.
I hope this helps!