Best way I've found is to not actually boil them. I steam mine and they peel perfectly just about every time. The age of the eggs seems to be less of an issue with this method although I have noticed that eggs that have been in the fridge for a week do slightly better. It's been the most reliable method I've found to consistently get eggs cooked the way I like and to peel easily.
Here is what I do:
Get steamer pot with an inch or two of water going to a full rolling boil. Steamer basket is inserted to preheat when water heats.
Place eggs in steamer basket and cover with tight lid - eggs should be in one layer and not touching the boiling water.
Steam for 9 minutes. (9mins gives me a creamy, slightly runny yolk which I prefer, go 10 for a cooked yolk if you prefer, longer for an even firmer yolk. Experiment on steam times to get your egg cooked the way you prefer)
Immediately take eggs out and submerge in ice water bath.
Allow eggs to fully cool.
I peel the eggs at the time of use. I store the cooked eggs in the shell in the fridge until ready to eat or use in a dish.
One great thing about this method is you can do 1 or a dozen eggs with the exact same recipe. You don't lower the temp of the boiling water by putting the cool eggs in the boiling water.
Here is a neat article about this same subject:
https://www.cooksillustrated.com/articles/168-easy-peel-hard-cooked-eggs