Should the agreement run indefinitely (until further notice) the lease must be terminated before the end of the month that falls three months before you as a landlord want the lease to end. The tenant needs to terminate the agreement before the end of the month that falls one month before he or she wants the lease to an end.
If the sublease is fixed-term regarding the time of the rental period, the sublease will be terminated without notice at the end of the rental period. If you still have agreed on a period of notice, the landlord is obliged to give notice of termination of the agreement if he or she wants it to stop. The tenant does not have to terminate the agreement to be allowed to move at the end of the rental period.
The same notice periods that apply to a permanent agreement (until further notice) also applies to fixed-term contracts (three months for the landlord and one month for the tenant).