597.0.1. A trust is deemed to cease to be resident in Canada at the earliest time at which the trust becomes an exempt foreign trust in a particular taxation year (determined without reference to section 785.2) of the trust if(a) the particular taxation year immediately follows a taxation year throughout which the trust was deemed under section 595 to be resident in Canada for the purpose of computing its income; and
(b) at a specified time in the particular taxation year,i. there is a resident contributor to the trust or a resident beneficiary under the trust, and
ii. the trust is an exempt foreign trust.