Why not just apply to it to non-resident aliens (a federal income tax status) rather than to people who aren't US citizens or permanent residents (which is related to nationality/immigration status).
All US citizens are tax resident. All permanent residents are resident aliens. However, by defining things this way, you are excluding people who are living in the US on a temporary work visa (e.g. H-1B, TN, L-1, etc.) and other temporary residents who are, nonetheless, very much resident in the US, in that they spend over 183 days in a year (or more than 4 months per year averaged over 3 years; the rules are kind of complicated) in the US.