How to get the most out of your retirement savings by understanding the tax rules