For purposes of this chapter, in determining the number of qualifying quarters of coverage under title II of the Social Security Act [ et seq.] an alien shall be credited with—
((1)) all of the qualifying quarters of coverage as defined under title II of the Social Security Act worked by a parent of such alien before the date on which the alien attains age 18, and
((2)) all of the qualifying quarters worked by a spouse of such alien during their marriage and the alien remains married to such spouse or such spouse is deceased.