Why does the comets are able to cross the planets orbit without touching the planet
Why not they get attracted by the planets when they are in their orbit.
They are attracted to the planets, but unless they get very close to a planet, the Sun's attraction is dominant by quite a margin and the planets only have very small effects on the comets' paths.
"Touch" would be the same as "collide" in this context. The distances are simply huge and in general they are not going to be that close.
Why the force of gravitation could not attract or compel the COMET to rotate around them.
The Sun's the big force and you need to be much closer to a planet to be significantly affected by its gravitational attraction compared to the Sun's. Jupiter is the next most important (which is why Jupiter has, over huge timescales, built up a large number of small moons).