Following the draw conducted in Yaounde on Monday, Morocco will play against Ghana, Gambia and Tanzania in a tricky group.
Hosts Mauritania will play the opening match of the 12-team competition against Cameroon on 14 February in Nouakchott.
The tournament will be played in the two cities of Nouakchott and Nouadhibou.
Nouakchott will host two groups at the Stade Olympique and Stade Cheikha Ould Boïdiya while matches in Nouadhibou will be played at Stade Municipal de Nouadhibou.
This is the first time the Total U20 Africa Cup of Nations has been expanded to 12 teams instead of the eight in previous tournaments.