If you are applying as a skilled worker, you need to have been admitted to the US with a 1 year visa at some point to be able to apply in the US. This is true even if the visa has since then expired. If you are a spouse being sponsored or a spouse going in on your partners application, then your status does not matter.