1.—(1) For the purposes of paragraph 2(a) and paragraph 7(b) of Schedule 1 a person shall be treated as being ordinarily resident in Scotland on the relevant day if the Scottish Ministers are satisfied that they were not actually so resident only because–
(a)that person, or their spouse or civil partner, or either of their parents; or
(b)in the case of a dependant relative in the ascending line, their child or child’s spouse or civil partner,
was for the time being–
(c)employed outside Scotland; or
(d)attending a course of study or undertaking postgraduate research outside Scotland.
(2) For the purposes of paragraph 2(a) of Schedule 1 and subject to sub-paragraph (3), a person shall not be treated as being ordinarily resident in Scotland on the relevant day if the Scottish Ministers are satisfied that their residence there on that day is in any sense attributable to, or connected with, any period of residence in Scotland within 3 years immediately preceding the relevant day as respects any part of which its purpose was wholly or mainly that of receiving full time education.
(3) Sub-paragraph (2) shall not apply to a person who has acquired settled status in the United Kingdom under the Immigration Act 1971 as a result of residence for full-time education which has led to a right of permanent residence arising under Directive 2004/38.