If the rental agreement is unlimited you cannot terminate your tenant unless the tenant violates the lease agreement. This could be if the tenant does not pay rent.
The tenant can terminate the rental agreement. The termination notice of the tenant depends on the lease agreement but it is normally between 1 and 3 months.
In case of subleasing and time limited rental periods, the lease is interminable within the agreed rental period. In return, the lease terminates automatically when the rental period ends.