When you buy a house with a mortgage, you are valuing the property as X, and the lender is also valuing the property as X. That's your cost, and no gain yet. If the value increases in a few years, it's unrealized gain.
Now, if you want to use the increased value to get a HELOC, that would be considered 'realizing the gains'. If eventually you pay off the mortgage and either sell the property or use it as a collateral to buy another property, that is also 'realizing the gains'.