How long does a spouse have to be separated before a divorce is automatic in Scotland?

Two. But divorce proceedings can begin beforehand.