At least 60 days before the last day of the rental period, or their lease.
Most landlords require that new tenants pay a deposit before they move in. When a landlord asks a tenant to pay the last month's rent, this is a rent deposit not a security deposit. Security deposits are not allowed in Ontario.
If your landlord wants to use the unit themselves (or for their family) they must also give you the equivalent of one month’s rent or offer you another unit.