David retires and gifts the ownership of his existing main residence to his son, Duncan. In return, Duncan grants David a liferent over the dwelling. This dwelling is worth £100,000.
David then buys a second home for £125,000. At the end of the day that is the effective date of the transaction, David "owns" two dwellings (the second home plus the dwelling in which he holds a liferent interest and of which he is deemed to be the owner ("deemed ownership")) and has not replaced a main residence. As the market value of the dwelling of which David is the deemed owner is over £40,000, the ADS will apply to the second home transaction.