Praise be to Allah.
If a man buys a house, and agrees with the seller that he will not hand over the price until the seller vacates the house, this condition is permissible and there is nothing wrong with it.
With regard to zakaah on this sum of money that the purchaser is still keeping, the purchaser must pay zakaah on it, because the money is still in his possession, and he has full control of it and is able to dispose of it however he wishes.
The seller does not have any right to this particular cash; rather the purchaser owes him that money conditionally.
The scholars have stated that one of the conditions of zakaah being obligatory is having full possession of the nisaab [minimum threshold of wealth at which zakaah becomes due].
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said: What is meant by full possession is full control, meaning that the wealth is not subject to the possibility of not being acquired. If there is a possibility that he will not be able to acquire it, then no zakaah is due on it.
They gave as an example of that rent for a house before the end of the rental term; there is a possibility that the landlord may not acquire it, because it is possible that the house may collapse, in which case the rental contract is rendered null and void. End quote from ash-Sharh al-Mumti‘ (6/17).
In this case, the purchaser has full possession of the money (with which he intends to buy the apartment), so he must pay zakaah on it.
And Allah knows best.