You have not accrued unlawful presence as long as there is not affirmative determination by USCIS or an IJ that your student status ended. Thus, you should not trigger the unlawful presence bar that prohibits the Consulate to issue you a new visa when you depart but you will certainly face serious questions whether you can be entrusted with a new visa. Whether those questions can be addressed depends on specific circumstances that cannot be addressed here.
You cannot regain status here in the US. To regain status, you must return home and apply for a new F-1 visa stamp.
J Charles Ferrari Eng & Nishimura 213.622.2255 The statement above is general in nature and does not constitute legal advice, as not all the facts are known. You should retain an attorney to review all the facts specific to your case in order to receive advise specific to your case. The statement above does not create an attorney/client relationship. Answers on Avvo can only be general ones, as specific answers would require knowledge of all the facts. As such, they may or may not apply to the question.
You will need to apply for a new passport to leave the country. DHS will scan that passport when you leave, so they will know when you left the country. An F-1 visa has an expiration date, but is usually good for "duration of status" or "D/S." Your school may have reported you as being out of status when you failed to re-enroll because they will often check international students. If the visa expired, you will have to reapply outside the US. You might have to explain the gaps in your status at this time and may be found inadmissible.
USCIS guidance on "duration of status":
"As an example regarding duration of status, if you have a visa that is valid for five years that will expire on January 1, 2009, and you are admitted into the U.S. for the duration of your studies (often abbreviated in your passport or on your I-94 card as "D/S"), you may stay in the U.S. as long as you are a full time student. Even if January 1, 2009 passes and your visa expires while in the U.S., you will still be in legal student status. However, if you depart the United States with an expired visa, you will need to obtain a new one, applying at an Embassy abroad, before being able to return to the U.S. and resume your studies."
I would consult with an immigration attorney.
www.gassonlaw.com - Disclaimer: This a general answer to your legal question. Unless you have a signed engagement letter with me, you should not consider this information to be legal advice.