3. Notwithstanding section 2, a natural person is deemed to be resident in Québec if he or she lived in Québec for not less than 1,095 days during the 48 months immediately before leaving, and
(1) is a member of the Canadian Armed Forces;
(2) is an ambassador, minister, commissioner, civil servant or agent of Québec or of Canada;
(3) holds an office within the framework of a program sponsored by the Government of Canada or of Québec, or an agency of one of these;
(4) is pursuing a course of studies or a training program;
(5) is the married or civil union spouse or the minor child of a person contemplated in paragraph 1, 2, 3 or 4.