For any year you have not been a resident of Canada, you lose that year’s TFSA contribution room. For example, if you lived in Canada from 2009 to 2020, but not in 2021, your TFSA contribution limit is the sum of the limit for years 2009 through 2020, but does not include the 2021 limit.