Section 5. (a) Notwithstanding the provisions of section four, Part A taxable income, Part B taxable income and Part C taxable income, shall be exempt from all taxes imposed under this chapter if the Massachusetts adjusted gross income for the taxable year does not exceed the following threshold:
(1) in the case of a single person, eight thousand dollars, or
(2) in the case of a husband and wife filing a joint return or a person filing as a head of household, seven thousand six hundred dollars plus the deductions allowed under the following provisions of paragraph (b) of subsection (B) of section three of this chapter.
(A) an amount equal to that allowed for personal exemptions under clause (A) of subparagraph (1a) of said paragraph or clause (A) of subparagraph (2) of said paragraph, and
(B) an amount equal to the total exemption allowed under subparagraph (3) of said paragraph.
No tax imposed under this chapter shall exceed ten percent of the Massachusetts adjusted gross income less the aforementioned threshold; provided, however, that the provisions of this sentence shall not apply in any case where Massachusetts adjusted gross income exceeds one hundred and seventy-five hundredths of the aforementioned threshold. No exemptions shall be allowed under this section to a married individual filing a separate return, except for those individuals qualifying for head of household under section two (b) of the Code. In the case of a short taxable year, occurring for any reason other than residence during one portion of the normal taxable year and nonresidence during another portion, there shall be substituted for the above threshold amounts, those amounts which bear the same relation to such sums as the number of days in the taxable year bears to three hundred and sixty-five. With respect to a person who is a nonresident for all or part of the taxable year, Massachusetts adjusted gross income shall be determined as if he were a resident of the commonwealth throughout the entire taxable year.
(b) Notwithstanding any other provision of this chapter, no tax shall be imposed under this chapter upon any stock bonus, pension or profit-sharing trust qualifying under section four hundred and one of the Code or any individual retirement account qualifying under section four hundred and eight of the Code.