Ann and Barbara own a dwelling in California which they rent out and they rent another dwelling in Carolina which they use as their main residence. They decide to move back home to Scotland and buy a main residence there whilst keeping their rental dwelling. At the end of the day that is the effective date of the transaction, Ann and Barbara own two dwellings. Although they have purchased their next main residence, they have not replaced their existing main residence, therefore the ADS will apply.
If Ann and Barbara had decided to buy a dwelling in Scotland as a buy-to-let property to rent out instead of as a main residence, the ADS would still apply as they would not be replacing their existing main residence.