You can only adjust to conditional permanent residency status if you are maintaining legal immigration status.
Current legal status can be maintained by F1 student status, or OPT.However if you are in the U.S. and out of status for more than 6 moths and leave the U.S. you will be barred from reentering the U.S.for 3 years
Adjustment of status via an I-485 application cannot proceed unless the I-526 Petition is approved, but you need to have a legal status to adjust from. Otherwise, you may have to leave the country process through a US Consulate abroad.
Retaining an experienced US Immigration attorney, like those at our law firm, can help you create a strategy that works best with your current and planned US Immigration needs and goals.