You have the option of leasing on a month to month basis, requiring a notice of 30 days in writing when you leave or a yearly lease which requires a 60 day notice in writing and you may be obliged to pay rent until the end of the lease, all within the law. In most cases lanloards are willing to weaver your paying the balance or loosing your deposit if they find a renter to occupy the residence.
Be sure to do a "walk through" in the presence of the landlord and real estate agent and sign a formal document agreeing on the state of the residence to ensure that your deposit will be returned at the end of your commitment. Landloards are required to paint and provide all electrical household appliances and the renter is required to pay the first and last month's rent and a one month deposit in advance.