As mentioned above, one of the (not very surprising) reasons your landlord can terminate your lease is if you decide to stop paying rent. However, there’s another reason your landlord can ask you to move out: if they or their close relatives want to live in the apartment.
Eigenbedarf, or the fancy German term describing this situation. Your landlord will have to send you a formal termination letter. Usually, they will have to keep a three-month notice period. However, if you’ve lived in your apartment for more than five years, the notice period extends to six months.