> friend managed to stay in the country despite his i-94 running out.
His adjustment of status was pending so there's a grace period (check with your lawyer). He was basically waiting for his EAD/Advance Parole card at that point!
(IANAL) Once your I-485 is pending you can remain in the US for as long as it remains pending, on that basis. [1]
Most people also file an I-765 and I-131 alongside the I-140, I-485 and I-693 forms, and once approved, you'll be issued an EAD/AP combo card which entitles you to work in the US and return to the US on the basis of the pending I-485. This travel and employment eligibility is separate from any previous E-3 or TN status.
Once you file, you no longer have to maintain your previous nonimmigrant visa status, but if you don't, a rejected I-485 would subject you to immediate removal. If you do, you can return to your old status.
His adjustment of status was pending so there's a grace period (check with your lawyer). He was basically waiting for his EAD/Advance Parole card at that point!