In principle , neither party has the right to terminate a fixed-term agreement. It is legally binding for both parties for the agreed term. However, there are certain situations where it may be possible to terminate a fixed-term agreement.
A court may under certain circumstances give the tenant or the landlord the right to terminate a fixed-term agreement. For instance, the tenant may be given the right to terminate the agreement due to an illness or injury or the need to move to another area because of studies, work, the work of a spouse, or for other similar reason. On the other hand, the landlord may be given the right to terminate the agreement if they or a family member needs the apartment for an unexpected reason, or for other similar reason.
The party that did not terminate the agreement is entitled to a reasonable compensation for any damages caused by the premature termination. The compensation may be given for e.g. expenses related to finding a tenant and for any months the apartment was unused and not rented. The landlord may have to reimburse the tenant e.g. for expenses related to moving out.
A fixed-term agreement can always be terminated with a joint agreement by the tenant and the landlord. If this is the case, you should also agree on possible compensation for damages.