We praise Allah for having guided you, and we ask Allah to make you steadfast and know that Allah is Forgiving and Most Merciful. He rejoices over the repentance of His slave, even though He has no need of His creation. We ask Allah to bestow more of His bounty upon you.
You have to pay the zakah of the past years according to the amounts of money that you possessed after paying off the debts of each year. Once you are certain about the amount in any year, then you have to pay zakah on it. If you do not know the exact amounts, then guess and pay based on that estimate.
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) was asked:
A man was careless about paying zakah for five years, and now he is repenting. Does repentance free him of the obligation to pay zakah? If it does not free him of that obligation, then what is the solution? This wealth is more than ten thousand and he does not know how much it is now.
He replied:
Zakah is an act of worship towards Allah and it is the right of the poor. If a person withholds it, then he is violating two rights: the right of Allah and the right of the poor and others who are entitled to zakah. If he repents after five years – as stated in the question – then he is absolved of the obligation to fulfil the right of Allah, because Allah says (interpretation of the meaning):
“And He it is Who accepts repentance from His slaves, and forgives sins” [Al-Shoora 42:25]
But the second right still remains, which is the right of those who are entitled to zakah, the poor and others. So he has to hand over the zakah to these people, and perhaps he will attain the reward for zakah if his repentance is sound, for the bounty of Allah is immense.
With regard to working out the amount of zakah, he should estimate the amount of zakah as best he can, and Allah does not burden any soul beyond its scope. So if it is ten thousand, for example, how much is the zakah for one year? Two hundred and fifty. If the amount of zakah is two hundred and fifty, then he should pay two hundred and fifty for each of the past years, unless in some of those years he had more than ten thousand, in which case he should pay extra. If it was less in some years, then he should pay less zakah, accordingly.
As’ilat al-Bab al-Maftooh, Q494, session 12
And Allah knows best.