It’s not so much a tax penalty as the loss of a tax break.
If you sell your house, you'll need to pay a capital gains tax on any profits from the sale above $46,000 if you’re a single taxpayer, and $89,000 if you’re married. Your profits are calculated by subtracting the cost of selling from the sale price of the home, and then subtracting this number from the adjusted basis of the property, which is the original purchase price plus any improvements made to the home. The IRS will tax the net proceeds (sale price minus selling costs) at your ordinary income-tax rate if it's a short-term gain (realized in under one year) or a lower rate if it's a long-term gain (over one year).
Here’s the catch: If the home’s your primary residence and you’ve lived in it for at least two years, the IRS grants you a big exemption: You can deduct $250,000 in profits ($500,000 if you’re married), on top of your adjusted basis. For many homesellers, this exemption effectively reduces the amount of their taxable capital gains to zero. But if you sell the home sooner than two years, you can’t take it.  You are in effect penalized for selling so soon.