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?