Deductions & credits

Hey guys, hopeful thinking here perhaps...  IF I lived in the home 2 of 5 years preceding sale, therefore qualifying for the exclusion, BUT I moved from California a year or two before the property sale, let's say I'm a resident, now, of Tennessee, THEN the taxable portion of the gain on sale of property LOCATED IN CA triggers me to file a CA nonresident return, paying CA tax on the taxable gain?  Or I just happily file in TN and no CA tax due on that transaction cuz I'm no longer a resident?  I suspect wishful thinking, but maybe....!  Many thanks.