I sold my house after living in it only 18 months (less than the 2 year threshold), so I expected to have to pay capital gains tax on the profit. However, after I input all my info into TurboTax, I got this message: "You don't have to pay any income tax on this sale of your home because your gain of $10,702 was less than the maximum allowed of $375,000." Can someone explain why I don't have to pay capital gains even though I lived in the house for less than 2 years?
Because you indicated that you sold the home early due to a qualifying "unforeseen circumstance" (like a change in job, unemployment, change in health that required you to move, or a few other things). You are then eligible for a partial exclusion -- in your case, you lived there 75% of 2 years so you qualify for 75% of the normal exclusion of $500,000 for married filing jointly.
(I'm surprised it's exactly $375,000 since the exclusion amount is figured to the day. You must have owned the home for exactly 548 days -- 75% of 731 days.)