You cannot claim credits for the years where you were not a resident for tax purposes.
If you were an international student, didn't work in Canada, or did not have a permanent resident (school dorm doesn't qualify), you will not be able to claim the tuition credits.
Similarly, if you are a Canadian citizen but emigrated from the country and declared non-resident status but attended Canadian online schools, will not be able to claim those credits since you were exempt from paying taxes.
I hope this was helpful