So, the questions is does filing for any green card permit me to stay in USA?
The answer is no. Only those green card application in which there is no wait for a visa number (example: spouse or parent of a US citizen or EB1 category currently) permit you to stay in USA but only if AOS (I-485) is filed in a timely manner. That is the reason spouses of green card holders have to wait OUTSIDE USA for many, many years.