<prompt> Human: Ive been thinking about selling my rental condo and wondered if I can avoid capital gains:You also must live in that principal residence for 2 of the 5 years before you sell it.I lived in it 2011, 2012, 2013, then rented the last two years 2014, 2015. Right now it would be 2.5 years rented, meaning I lived in it for 2.5 before that. I was just wondering if I had to be in it THE LAST two years, or any two years within a 5 year period...Any answers would be appreciated!  <response>: Any 2 of the last 5 years. 