the gravity that sun has on the moon is about 2 times more than the gravity from earth so why doesn't moon run away from earth to sun?

The entire earth moon system is revolving around the sun once a year. Thus the moon is in equilibrium orbit about the sun with the gravity and centripetal acceleration due to motion about the sun exactly as the earth is.