Sell rental property you moved out of and lived in — no capital gains?
Trying to figure out if I can avoid capital gains on a property I originally bought as my primary home, lived in for about 3 years, then moved out and rented for the last 2 years before selling this past spring. Total gain is significant. I keep reading about the home sale exclusion but everything I find talks about it like you either lived there or you didn't. I did live there — just not recently. Already looked at the ownership and use test rules but the 5-year lookback window is confusing me. Does the time I actually lived there count even though it was a rental when I sold it? And does depreciation I took while renting change anything about what I can exclude?