When you sell a home, how do you determine what you made on the house while living there?

In other words, is it what you paid for the home, and then subtract what you still own on it? I don't remember how your capital gain goes.

When you sell a home, how do you determine what you made on the house while living there?
Post Opinion