If Ancelotti has decided to leave, it means he already has a plan for his future career in another place. The latest rumor I heard, he is expected to be the coach of Brazilian national team.
The Brazilian National team right now is a total mess and in little over 1 year there will be the World Cup: I really struggle to image Ancelotti accepting this type of offer while having only one year to prepare Brazil for the World Cup. If he actually manages Brazil will be after the World Cup, not before, there are just too many risks otherwise.
If Ancelotti leaves Real Madrid, he can accept Brazil's offer. Brazil made him a very good offer and managing Brazil is not a job that every coach can do. They have a good squad and Ancelotti can handle it. After the World Cup, he can start his deep analysis for better performance. Of course, not managing the national team will be his own decision. Maybe he will want to continue his struggle with the club team and manage another European team.