Yes, in some case you can sell your home for less than what you still owe on the mortgage. But it is complicated and depends on the lender. This situation is known as a “short sale.” Sometimes a lender will be willing to split the difference between the sale price and loan amount, which still must be paid.
A short sale may be more complicated if the loan has been sold to the secondary market because then the lender will have to get permission from Freddie Mac, the two major secondary-market players.
If the loan was a low down payment mortgage with private mortgage insurance, then the lender also must involve the mortgage insurance company that insured the low-down loan.