The entourage of the veteran Spanish goalkeeper, whose contract with FC Porto expired last month, has been negotiating with Madrid in recent months with a view to working under Real Madrid president Florentino Perez.
Casillas, 39, did not feature for Porto after having a heart attack in May 2019.
He served as an intermediary between the players and coaching staff at Porto this season and has yet to officially announce his retirement as a player.
Casillas had considered the possibility of running for president of the Royal Spanish Football Federation (RFEF) but recently stated he would not do so because of the coronavirus pandemic.
He had a tearful departure from Madrid in the summer of 2015 after a difficult season under Jose Mourinho.
Perez was criticised for failing to give Casillas, who had one year left on his contract at the time, the rousing send-off his 16-year first-team service warranted.
A youth product of Madrid, Casillas won three Champions Leagues and five La Liga titles at the Santiago Bernabeu and won two European Championships and the World Cup with Spain.
Sources involved in the deal say Casillas’ return is “good for all Madridismo” and follows Perez’s policy of bringing former icons back to the club, as was the case with current coach Zinedine Zidane, club director Emilio Butragueno and reserve team manager Raul Gonzalez Blanco.