There is no age cap on it, as I recall, but there may be a monetary cap.
Once you have made $300,000 or $500,000 profit on selling a home, we are no longer talking about anything that could cause a hardship for anyone. They could only tax the rest of the profits at 33% or so, anyway.
My point is that before someone does something really dumb, like buy a super-expensive house that will have tax and insurance premiums that will likely beggar them in retirement, one should find out exactly how much all possible alternatives will cost them.
There are people now who are losing tens of thousands on an SUV they bought that they only drive 20 miles a day. If they trade it in on a Prius, the savings will never catch up until gas it $12 a gallon in 2020.