Theory of the Mercury's spin-orbit motion and analysis of its main librations