We know that the Earth-Moon system revolves around the Sun. The gravitational force of the Sun on the system provides the centripetal force its revolution. Therefore, the net force on the system is zero and the Moon does not experience any force from the Sun. This is the reason why the Moon revolves around the Earth and not around the Sun.