The Sun's gravitational pull on the Moon is always stronger than the Earth's. (Do the math and see--on average the Sun's pull is more than twice as strong as the Earth's.) So the net acceleration of the Moon is always towards the Sun, never towards the Earth.