Mercury has the most noncircular or eccentric orbit of any nondwarf planet in the solar system. This eccentricity has trapped Mercury in a 3:2 spin-orbit resonance, where it rotates three times for every two revolutions. When nearest Sun at perihelion, Sun’s tidal forces are greatest, Mercury’s spin and orbit (or rotation and revolution) nearly match, and Sun momentarily reverses in Mercury’s sky.
For long times, Mercury’s orbit precesses due to the gravity of Jupiter, the oblateness of Sun, and spacetime curvature, first described by Albert Einstein’s theory of General Relativity. For short times, as the animation shows, one solar day lasts two years!