Hi Alina,
The fact that he lived such a long life is pretty impressive and shows that you really love your cockatiel and take good care of him. He's getting old, that's only natural.
My suggestion - get him to the vet to check that there aren't any specific illnesses, but mostly just go on loving him and giving him care and attention.
This site has a lot of good info, what they say about life span is that though most cockateils live 12-15 years, they can live up to 20 years and in rare cases even longer.
http://www.letstalkbirds.com/cockatiels.htm#two
I hope that he'll make it, if he dies of old age, I hope you take comfort in how awesome he was and what a great life you have given him.