Pioli replaces Marco Giampaolo, who was sacked on Tuesday.
His last role in management was with Fiorentina, who he left in April following a difficult run of results.
Milan only hired Giampaolo in the summer but parted company with the ex-Sampdoria manager following a difficult start to the campaign, which saw them languishing in 13th place with four defeats from their opening seven matches.
Pioli managed Inter for much of the 2016-17 campaign following the sacking of Frank de Boer after 12 Serie A matches, but was dismissed three games before the end of the season.
At Fiorentina, Pioli received huge plaudits for the way he helped steer the club forward following tragic death of captain Davide Astori in 2018. In the following campaign, he led the club to the Coppa Italia semifinals following a 7-1 victory over Roma in the last eight.
However, Milan are the 12th different side he has managed since 2003 and his longest stint with any one side was at Bologna for three seasons from 2011 to 2014.
Pioli has earned the reputation as a journeyman manager. He led Lazio to a third-place finish, in 2015 his best-ever Serie A position.
Milan finished the previous campaign in fifth place -- only missing out on the Champions League on the final day of the season -- but accepted a one-year European ban and are not competing in the Europa League.