The CMS experiment collected 162 fb^-1 of proton-proton collision data at sqrt(s)=13 TeV during the Run-2 data taking period of LHC. The CMS RPC system provided redundant information for robust muon triggering, reconstruction and identification. To ensure stable data taking, the CMS RPC collaboration has performed detector operation, calibration and performance studies. After the end of Run-2, it was started the second LHC long shutdown period (LS2), an important opportunity for maintenance and preparation for the next data taking period (Run-3) and future upgrades (Phase-II upgrade). The activities included, maintenance of power, gas and online systems. In preparation for Phase-II, gas pipes for future chambers have been installed, as well as kilometers of service cables (optical fibers, LV/HV cables). In this presentation, the overall performance of the CMS RPC system during Run-2 period is summarized as well as all the activities done in preparation for future data taking periods.