33.—(1) A person who—
(a)is settled in the United Kingdom;
(b)left the United Kingdom and exercised a right of residence before IP completion day after having been settled in the United Kingdom;
(c)was ordinarily resident immediately before IP completion day—
(i)in the territory comprising the European Economic Area, Switzerland and the overseas territories; or
(ii)in the United Kingdom, where the ordinary residence began after 31st December 2017 immediately following a period of ordinary residence in the territory comprising the European Economic Area, Switzerland and the overseas territories, and has remained ordinarily resident in the territory comprising the United Kingdom, the European Economic Area, Switzerland and the overseas territories throughout the period beginning on IP completion day and ending immediately before the course start date;
(d)is ordinarily resident in the United Kingdom on the course start date;
(e)has been ordinarily resident in the territory comprising the United Kingdom, Gibraltar, the European Economic Area, Switzerland and the overseas territories throughout the three-year period preceding the course start date; and
(f)in a case where the person’s ordinary residence referred to in paragraph (e) was wholly or mainly for the purposes of receiving full-time education, was ordinarily resident in the territory comprising the United Kingdom, Gibraltar, the European Economic Area and Switzerland immediately before the period of ordinary residence referred to in paragraph (e).
(2) For the purposes of this paragraph, a person has exercised a right of residence if that person is a United Kingdom national, a family member of a United Kingdom national for the purposes of Article 7 of Directive 2004/38 (or corresponding purposes under the EEA Agreement or Swiss Agreement) or a person who had the right of permanent residence who in each case has exercised a right under Article 7 of Directive 2004/38 or any equivalent right under the EEA Agreement or Swiss Agreement in a state other than the United Kingdom or, in the case of a person who is settled in the United Kingdom and had the right of permanent residence, if the person had gone to the state within the territory comprising the European Economic Area and Switzerland of which the person is a national or of which the person in relation to whom the person is a family member is a national.
(3) For the purpose of sub-paragraph (2), a person had the right of permanent residence if they had a right which arose under Directive 2004/38 to reside permanently in the United Kingdom without restriction.