Filing Status for F2 spouse who just came to the US

I came to the US in 2017 as F-1 student, and my wife just arrived in the US in June 2022. The question is, how to determine the filing status for my wife? (She may have some income prior to her arrival in foreign country, which makes this case complicated.)

 

1) If she stays less than 183 days and we decide to file separately, can she maintain non-resident tax filing status and use 8843 form?

 

2) If she happen to be present for 184 days in 2022, how to determine her filing status? The official instructions from IRS on exempt student was not clear to me (https://www.irs.gov/individuals/international-taxpayers/exempt-individual-who-is-a-student). I am not sure if she can count 5 years on her own (then this is her first year as an exempt student), or she must follow my status (i.e. I need to count 183 days from the first day in 2022, and so does she)?

 

If her days count on me, since she arrived in June, would the days between her arrival (in June) to July 3, 2022 (the date that I became a tax resident) exempt from the substantial presence test?

 

Thank you very much.