Capital Gains tax on selling an apartment

Is anyone able to enlighten me on how Capital Gains tax on selling an apartment works because I am in a sorry state of confusion. I understand the TAX RATE I would pay depends on what tax band I am in once the gain is added to my other income e.g salary. For arguments sake lets say it is 40% - my question is 40% of what?. If it is 40% of the increase in value I would think this is stiff compared to UK where it is zero for owner occupier. A complex subject for sure but any help gratefully accepted.

:notworthy: It is still complex but I have been told that there are “ways and means” round this tax. Basically tax is levied on sale price of land and this can be flexible as agreed between buyer and seller. I will update as I discover more on this arcane subject. Viva Taiwan !!