There are certain instances where one can apply for Adjustment of Status and be out of status. One such exception is called 245(i). If you had an I-130 or I-140 filed prior to April 30, 2001 and were physically present in the U.S. on December 20, 2000, then you could apply for Adjustment of Status even though years of being out of status.
However, you must know that being under 245(i) does not protect you if you are inadmissible based on a crime or fraud or other items which make somebody inadmissible.
There was an initial 245(i) which allowed filing of the I-130 or I-140 prior to January 1998. If your under this version of the 245(i), then there is no physical presence requirement as there is with the other 245(i).
When you file the Adjustment of Status under 245(i), there will be $1000 penalty. However, it is more preferable to pay this penalty than having to do a waiver, leave the U.S. and possibly not be able to return.
There are derivative beneficiaries of 245(i). Those would be spouses and children. Of course, in some respect, it will depend when these beneficiaries were acquired to determine if they fall under 245(i).
Note that you can be under 245(i) from a petition that is not current and still file an immediate relative petition such as from a USC spouse. This way, you do not have to wait more years to file the application.
In order to show you were physically present on December 20, 2000, you should have receipts, declarations and other evidence to show that you were actually here at that time in the U.S.