When renting out a time-unlimited property, the landlord cannot terminate the tenant, unless the tenant violates the lease agreement (e.g. not paying rent). This means, that unless you do not hold up your end of the agreement, the landlord cannot ask you to move out.
The termination notice of the tenant depends on the lease agreement but it can be anything between 1-3 months. This period often matches the prepaid rent.
In the case of subleasing and time-limited rental periods, the lease is interminable within the agreed upon rental period. In return, the lease terminates automatically upon end of rental period.