Deductions & credits

See publication 523.

https://www.irs.gov/forms-pubs/about-publication-523

 

There is a partial exclusion if the reason you are selling before the 2 years is up is due to certain unexpected financial or personal hardships.  But if there is no hardship involved and it was just your free choice of living arrangements, the entire gain is taxable because you don't qualify for the exclusion.