Selling a primary residence in less than 2 years. Will I have to pay cap gains? What is the base profit is calculated off? Sale amount? Original Mortgage? Amount owed?

House was listed ~600. Downpayment put mortgage down to ~500. Amount owed currently is ~450. Sale of current house will be ~635. Married filing jointly. Which amount is the profit calculated off of?
KrisD
Intuit Alumni

Get your taxes done using TurboTax

The gain will be based off your basis. 

The basis will be the cost (purchase price), improvements, and selling costs. 

How much you borrowed or put down is irrelevant. 

Get your taxes done using TurboTax

Thank you for the response. So, just to clarify, the profit 'gain' will be based off the listing/ agreed upon sale amount of the home, in this case ~$600? The basis will not be taken from the finalized sale amount of the home after we put the downpayment down? If this is the case, our profit will be in the neighborhood of 35k. We have been in this house for just a few months shy of the two year requirement and we file married jointly. With such a small profit, will we have to pay long term cap gains?