The termination of your lease agreement is subject to its terms and conditions. Note that it is a different process from the cancellation of your booking.
It is a matter to solve directly with your landlord in accordance with the contract rules. Therefore, be aware of its conditions before signing, and check the time required for move-out notice.
In general, a penalty may be applied due to the early termination of your agreement, best to make sure you follow the agreement accordingly.