Costa started the 2020/2021 season with the Old Lady but was loaned out to German champions Bayern Munich for the remainder of the campaign.
The 30-year-old only made 20 appearances across all competitions in Bavaria, where he previously spent two seasons, as a result of fitness issues and scored one goal, winning the Bundesliga and the FIFA Club World Cup.
Costa’s contract with Juventus expires next summer but his time in Turin is effectively over as he will spend the final year of that deal back at where it all began at Gremio before becoming a free agent.
Juventus announced on their website: "Douglas Costa has officially signed for Gremio on a free loan from Juventus.
"The Brazilian winger, who joined Juventus back in 2017 and spent this past season on loan at Bayern Munich, will wear the shirt of the Porto Alegre outfit until 30 June 2022."
Costa started his career with Gremio before earning a transfer to Europe by joining Ukrainian outfit Shakhtar Donetsk in January 2010.
Costa has won 31 caps for the Brazil national team and scored three goals.