Say I buy a home at the listing price of 100K. Let's assume that the loan amount is 150K.
This situation would never happen. A bank would not write a mortgage for 150% of the value of the property
Later, when selling the home, let's assume that the market has not changed and that I sell the house for what it's worth, 100K.
Does that mean that I owe the bank 50K? That seems wrong to me, but I'd like to be enlightened.
Assuming you only made interest payments on the impossible loan then yes, you would owe the net amount remaining on your loan.
Typically a lender requires some amount of a downpayment primarily to avoid this situation. Say you buy your $100,000 house, and you put 20% down; your loan will be for $80,000. That means you could experience a 20% value decline and the lender can still foreclose on you and sell the property without losing any money (obviously ignoring transaction costs).
You seem to be really confused about interest. Interest is generally paid monthly on the outstanding principle of the loan. To calculate this assume a 5% interest rate and a $100,000 loan:
$100,000 * 0.05/12 = $416.67
So your first month interest payment is $416.67. Typically loans are amortized so the borrower pays a set predictable amount each month, we'll assume a 30 year mortgage.
=pmt(0.05/12, 30*12, -100000)
Which gives you a monthly payment of $536.82. So every month you pay $536.82, every month a reducing amount of that is interest (the amount reduces each month because the outstanding principle on the loan reduces as well).
So after the first month
Principle Interest Payment
Month 1: $100,000 + 416.67 - 536.82
Month 2: $99,879 + 416.13 - 536.82 (the interest reduces because the there is less principle remaining)
Assuming your loan doesn't have a prepayment penalty, if you sell the property you don't owe any of the interest that would have been due in the future because you will pay off the remainder of the loan with proceeds from the sale of the property and keep whatever excess remains.
Your $100,000 loan is a loan for $100,000, not a loan for $536.82 * 360 = $193,255. You don't add all the expected interest in to the loan to express its value.