[Category 5A - Persons who are settled in the United Kingdom and have exercised a right of residence elsewhereE+W
5A.—(1) A person who—
(a)is settled in United Kingdom,
(b)was ordinarily resident in Wales and settled in the United Kingdom immediately before leaving the United Kingdom and who has exercised a right of residence before IP completion day,
(c)was ordinarily resident immediately before IP completion day—
(i)in the territory comprising Gibraltar, the EEA and Switzerland, or
(ii)in the United Kingdom, where that ordinary residence began after 31 December 2017 immediately following a period of ordinary residence in the territory comprising Gibraltar, the EEA and Switzerland,
and has remained ordinarily resident in the territory comprising the United Kingdom, Gibraltar, the EEA and Switzerland throughout the period beginning on IP completion day and ending immediately before the first day of the first academic year of the course,
(d)is ordinarily resident in the United Kingdom on the day on which the course begins,
(e)has been ordinarily resident in the territory comprising the United Kingdom, Gibraltar, the EEA and Switzerland throughout the three-year period preceding the first day of the first academic year of the course, and
(f)in a case where the person’s ordinary residence referred to in paragraph (e) was wholly or mainly for the purpose of receiving full-time education, was ordinarily resident in the territory comprising the United Kingdom, Gibraltar, the EEA 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 sub-paragraph (3) or (4) applies to the person.
(3) This sub-paragraph applies to a person who is—
(a)a United Kingdom national,
(b)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 of Swiss Agreement), or
(c)a person who had the right of permanent residence, who 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.
(4) This sub-paragraph applies to a person (“P”) who—
(a)is settled in the United Kingdom and had the right of permanent residence, and
(b)has gone to the state within the territory comprising the EEA and Switzerland of which P is a national or of which the person in relation to whom P is a family member is a national.
(5) For the purposes of this paragraph, 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.]