I’m assuming married filing separately as filing status since you’re likely claiming the foreign earned income exclusion and will owe nothing.
On this assumption, just use freetaxusa.com’s prior year software (here) to do 2022, 2023, and 2024. You will need to do a paper return for 2022, and because your spouse presumably doesn’t have an SSN and you’re already filing paper for 2022, you might as well do it paper for 2023 and 2024 as well as it’ll be easier (and might be required for 2023.) For the years you are married you will select “Married Filing Separately” and write in “NRA” (for non-resident alien) in the spot where it asks for SSN/ITIN. Mail these in (using the registered mail service of your country; not courier) to the the addresses listed on the IRS website that best describe your situation. This all need to be mailed (not courier) separately.
Take a photocopy of all signed returns and proof of mailing you received from the foreign mail service.
Depending on timing, rinse and repeat for 2025.
I would also suggest doing 2021 and any missing within the last 7 years for other reasons, but your last three years until tax filing opens up in a few weeks is what’s needed for immediate immigration purposes.
Also I ordinarily would not recommend paper returns or MFS, but given your situation it’s the absolute quickest way to get it done unless you want to pay a certified acceptance agent to handle it for you, which would be costly and time consuming.
If you don’t qualify for the foreign earned income exclusion your best bet is to talk to a certified acceptance since multi-jurisdictional taxes not covered by FEIE it become really complicated really fast.
Disclaimer that is neither tax or legal advice and if you’re uncomfortable following the instructions on Free Tax USA you should consult a competent tax advisor licensed to practice before the IRS (this goes for any other tax software of your choice; not endorsing FTUSA, but they are usually considered the least scammy tax software.)