Vince and Andy are purchasing a dwelling together. They each currently own a dwelling and each currently use their own dwelling as their main residence. Vince is selling his old main residence but Andy is not. For Andy, the new purchase will be an additional dwelling. As, at the end of the day that is the effective date of the transaction, Andy will "own" two dwellings and has not replaced a main residence, the ADS will therefore apply to this purchase.
The fact that Vince is replacing his main residence does not matter as, for the purposes of the LBTT(A)(S)A 2016, Andy is treated as if he is the owner of the newly purchased dwelling ("deemed ownership") and he has not replaced his main residence.