My spouse is on F1 visa and have got 1042-S(form for income tax treaty).
We are filling taxes jointly, so he might be considered resident alien for tax purposes.
While filling the MA state taxes , Can we enter the amount on the 1042-S in the Qualifying Student or not
No, Form1042-S, Foreign Person's U.S. Source Income Subject to Withholding, is not meant to report a qualifying student.
The purpose of this form is to advise the IRS that income paid to a Foreign Person is U.S. sourced.
Whether your income is subject to a reduced rate of withholding (due to claim of tax treaty benefits on form W-8) isn't relevant. It can be confusing because it is possible to claim a treaty and not withhold. It might be easier to think of the 1042S as a 1099 MISC.
To report form 1042S on TurboTax, you'll have to enter the information as miscellaneous income based on income code in Box1.
For more details on how to do it, view this step by step TurboTax article. Be sure that you enter it correctly on the Federal Side and then move to MA state.
For Qualifying Student, the amount should be $0 because it refers to wages and salary income. If the income received by your spouse is reported on a 1042-S, then like a 1099-MISC, it is paid independently and not as an employee. Wages / salary do not apply.