If your spouse is in the US on a dependent visa (J-2 or F-2) with no U.S. income, they only need to file Form 8843.
Include your spouse’s details in Step 5 – “About your college/program.” The system will then generate Form 8843 for them.
Print and mail this form separately to the IRS, as it cannot be filed electronically.
Info: In case your spouse has earned US income regardless of their Visa status, they are will have some filing obligations and they can prepare the needed returns through a separate Sprintax account.