Income tax is just income tax. It's tax on your income. In belgium in some cases capital gains can be considered a diverse income.
A natural person who lives in Belgium, will have to pay income tax in Belgium on his worldwide income. For each year it will be determined if you lived in Belgium. Living in Belgium means that you have the principal seat of your worldwide fortune in Belgium. Depending on the facts, the Tax Office will determine if you lived in Belgium.
Also a company based in Belgium, will pay income tax in Belgium on the worldwide income.
As income made in foreign countries might already have been taxed outside Belgium, doubble tax treaties with some countries avoid doubble taxation.
Income from real estate is taxed. This is the rent you recieve. Also your income from real estate in other countries is taxed, but tax treaties with other countries avoid doubble taxation. Belgium has no such treaties with Spain.
Professional income is taxed. This can be your wage, your profit or a pension. Also in this field tax treaties exist to avoid doubble taxation.
Diverse income is taxated. Under this category falls the very limited capital gains tax. Only the sale of real esate located in Belgium within the 8 first years after aquisition can be taxed on the capital gains, but for companies, their property will be valuated at the moment it's sold or when the company is liquidated, and then the capital gains will be considered an income of the company (profit) .
Interest, divided, ... are also considered income. Capital gains on stock market investments isn't income, so it isn't taxed.
Every year you have to make an income tax declaration, in which you declare all your income.
All your income is added together and then it will be taxated with a progressive scale. Once you ear 50.000 euro half of what you earn extra will have to be payed as income tax.If you have much income, you will have to give half of it to the Belgian Tax Office.
This page is free general information to communicate the ideas. For exact legal advice, you should consult a professional and present him your case.