We investigate the solar modulation effect with the long-time cosmic ray (CR) proton and helium spectra measured by AMS-02 on the timescale of a Bartels rotation (27 days) between May 2011 and May 2017. The time covers the negative heliospheric magnetic field polarity cycle, the polarity reversal period, and the positive polarity cycle. The precise AMS-02 data provide an excellent opportunity to improve the understanding of the time-dependent solar modulation effect. In this work, a two-dimensional solar modulation model is used to compute the propagation of cosmic rays in the heliosphere. The CR propagation equation is numerically solved by the public code solarprop. We find that the drift effect is suppressed during the high solar activity period for a long time but nearly recovered in the first half of 2017. The time-dependent rigidity dependence of the mean free path is critical to reproduce the observations during the polarity reversal period. We also confirm that protons and helium have the same diffusive mean free path. The future monthly AMS-02 and PAMELA data will further confirm the vital assumption about the universal mean free path for all species. The monthly antiproton data will be crucial to break the degeneracy between the diffusion and drift effect and determine the level of drift effect during different epochs.