It’s more correctly called the ITP (Impuesto sobre Transmisiones Patrimoniales). Often people say VAT (IVA in Spanish) interchangeably.
In most cases it will be 8% and this is paid by the buyer.
This is where the seller is a private individual not a professional developer and the price is under 400,000€.
If the price paid is over 400,000€ then you pay a bit more:
9% applies to the sum between 400,000 and 700,000€
10% applies to the sum over 700,000€
If the seller is a business or a professional developer then VAT is 21% and stamp duty is 1.5%
If the purchaser is a business such as a limited company (sociedad limitada) then it will be able to recover the VAT.
You should take specialist tax advice on the pros and cons of doing this if you are thinking of setting up a limited company specifically to recover VAT in these circumstances.
Lawyer’s fees are typically 1% to do the conveyancing.
Notary fees and Land registry: these will vary according to the circumstances and in most circumstances will be a few hundred to a thousand euros.
If the vendor is not Spanish consult your lawyer to make sure you are not caught by Plus Valia (capital gains) that is paid by the seller and other retentions you may be obliged to withhold.