You owe rent until the end date of your lease or whatever other date you and your landlord agree to.

If you leave without any sort of agreement, your landlord may sue you for the balance under the lease. You can assert as an affirmative defense that your landlord has/had a duty to mitigate by finding a replacement tenant. If the landlord chooses not to find a replacement tenant and, instead, chooses to put the house on the market, that may impact his ability to recover from you. My guess is that, in most cases, the court would award the landlord a judgment based on how long it reasonably would have taken the landlord to find a replacement tenant.