When you sell your house hopefully it’s worth more than what you paid for it. If it is then congratulations you made money!
Of course anytime anyone makes money, the government wants a piece. However when you make money on your house you can keep some if not all the money for yourself. That’s because of the capital gains exemption.
What that means is that if you are single and net $250,000 on the sale of your home you do not have to pay anything to the government. Anything over $250,000 is taxed.
If you are married then you get to pocket up to $500,000 tax free. One note is that you can only do this every two years. Which isn’t a problem for most people since they are in their house a lot longer than that.