For what reasons as a renter can you legally break an apartment lease?
In general, the landlord has responsibility (under varying health and safety laws) to keep the apartment in habitable condition. An uninhabitable apartment (because of health or structural concerns) is one reason for renters to seek to break agreements without penalty. But follow proper procedures and be sure to obtain enough evidence to make a case before a judge, should it come to that.
If you are forced to move because of deployment orders from the military, reserves, or National Guard, then you may be protected from penalties that would result from breaking an agreement, so long as you can present your orders to your landlord.
There are other valid reasons for breaking an apartment lease, but almost all of the ones not listed above will result in some sort of financial penalty. There are various things that can be done (such as discussing things with the landlord) to mitigate undue hardships and make the transition smoother for everyone.