If the couple have lived together since the separation for periods of less than six months this will not prevent a divorce on these grounds, but the period of living together will not count as part of the two years or five years. For example, if a couple separate and then live together for five months before parting again, they cannot petition for divorce until two years and five months have passed since the initial separation.
The start of the period of separation does not have to be formalised.