I feel that performance and contribution level to the team is what decides that a coach has to go and not necessarily the age. So long as a coach can keep a viable technique on the pitch and produce good outcomes, age bias will disappear, apply to Ancelotti at Real Madrid. However, the scenario when Guardiola can wait until the non-renewal of Ancelotti’s contract, is not reasonable since the coach of Guardiola’s caliber will always attract the interest of many clubs who would be ready to approach him when he is available. As the schedule in the contracts in two teams are not corresponding to each other, the possibility to see such change remains low, more so if the topcoaches tend to seek new projects according to their goals and without waiting for the change of other coaches.
Age does not determine the level of performance of a coach in managing a team, but Real Madrid need to think long term to secure a coach with the best quality. Ancelotti could be able to handle Real Madrid for the next two seasons, but Real Madrid also need to think about how to get a coach like Pep Guardiola. At the moment it is difficult for Pep Guardiola to become the coach of Real Madrid because he is still focused on Manchester City, but who knows for next season because he also did not rule out the possibility of leaving Manchester City.
No doubt that Carlo ancelotti has proven to everyone that he is made for real madrid and only the way he has been successful at the club speak volume of how good and suited he is for real madrid, but right now, it's very much true that retirement of his glorious coaching career is very close, which I believe might come at the end of his present contract at the club, but the question here is who is suites to take real madrid forward?
Though you made mentioned of pep guardiola which truly is the kind of top manager that can handle real madrid, but his affiliate with Barcelona will definitely not bring this deal to reality, so in my own opinion, I think that the ideal person that can take real madrid forward after carlo ancelotti is xabi Alonso, the current manager of Bayern Leverkusen, he has already proven in his short coaching career that he has what it takes to lead a top team, so I believe that he is the ideal man to take real madrid forward after carlo ancelotti.