If you are legally maintaining your F-1 status, and if during this time the I-526 Petition is approved, then you may apply for conditional permanent residency (CPR) by filing an I-485 Application in the U.S. That is, you are applying for CPR while you are remaining in the U.S. At the same time you file your I-485 application you can also apply for permission to leave and legally return to the U.S. while your I-485 application is pending.
It may be advisable to file for the adjustment of status as soon as possible. You can also concurrently file for travel authorization in anticipation of adjusting to permanent resident status, but you will have to remain in the US while that application is pending (travel authorization could be granted in 90 days, while adjustment may take several months).