Deductions & credits

So from the moment I lived in the home even on land contract it still counts toward the 2 year requirement. I was curious if it only counted if the house was mortgaged in my name.