It varies in the terms of the lease contract. I've had LL's who would let you off the hook nice like (usually the private owners) but your typical property mgt will have a provision for it. My current LL has terms that I must:
1. Give 30 days notice beginning on the 1st of a month and ending at the end of a calendar month.
2. Forfeit my deposit.
3. Pay all rent to the end of occupancy (of course.)
4. Pay an additional amount equal to a month's rent as a penalty for breaking the lease.
So basically it would cost me the equivalent of a deposit and one month's rent to get outta this early.
I've also had LL's terms state that 3 months rent would be the penalty, or that all monies collectible for the entirety of the lease would be payable (but that was another state, and tenant/LL law varies by state.)
If you're looking to buy within 6 months, I'd seriously look for shorter leases, or month to month options. Most of the property mgt companies are also real estate companies. If you imply that you might become a buyer from them if they can get you a favorable lease situation, you might have some leverage.