I don't even know where to start, but no, they are not the same thing. You get to live there, that's largely where the similarities end.
>"I bought my home for 500k 15 years ago. It is now worth 1M$, therefore I made 500k$").
Assuming 2k rent (for a 500k home), renting would have cost you $360000, and that's just a net loss. On a 30 year mortgage, the mortgage would be 2100 a month. You would have paid off $196000, be able to realize the gains, and it's incredibly unlikely you spent $196000 on repairs in 15 years. And your mortgage would not have increased in that time.