Well, technically, never… Or depends…
Sasuke hasn’t ‘returned’ to the village per se even as of today in Boruto. Sasuke, however, has his crimes pardoned by the Sixth Hokage, Hatake Kakashi after his aid in the war against the Ohtsutsuki.
Sasuke left the village during the Chunin exams after being lured by Orochimaru. Hungry for power ad revenge, Sasuke deserted the village being caught by Orochimaru’s curse mark that gave him a certain level of power.
Naruto was able to catch up with Sasuke thanks to Lee’s phenomenal fight with Kimimaru. Naruto tried to get Sasuke back by force by fighting him at the Final Valley. By the Kakashi arrives, Sasuke has already left.
In Shippuden, Sasuke has his own journey by murdering Orochimaru and leaving with his own ragtag team of Karin, Jugo, and Suigetsu.
His quest to become more powerful so that he can exact revenge on his brother continues as he joins the Akatsuki.
Finally, fighting his brother, he can say that his revenge has been completed but a startling truth sends him on yet another journey.
Sasuke joins the war in order to learn the truth about Itachi after having killed Danzo. Orochimaru gladly offers his help.
The Third Hokage is finally able to tell Sasuke the complete truth and then he decides to destroy the village totally that gave his brother so much pain.
Later he concludes that destroying the village will do nothing if his brother went so far as to save it. So, he decides that he is going to be the Hokage instead and take on all the darkness of the village.
In order to be Hokage and save the village, Sasuke joins the Fourth Great Ninja War. During this battle, Sasuke met The Sage of the Six Paths and received half chakra from him.
Once the Ohtsutsuki is defeated, the immediate uniting threat is gone. Thus, he returned back to his fight with Naruto to defeat him to be Hokage.
This fight, at the final valley again, ended in both of them losing an arm. Sasuke was finally able to recognize that his friendship with Naruto was all he needed to cure his loneliness.
After the war, Sasuke accepted his punishment as a prisoner of the village. Kakashi, however, being the Sixth Hokage, pardons his crimes for his aid during the Fourth Great Nina War considering it was a threat to not only the Leaf Village but also to the entire Shinobi-kind. This could in a way mean that Sasuke returned to the village since he is not exactly an outlaw anymore.
However, Sasuke decided that he wanted to go on a journey. This journey would be for his redemption where he would travel and protect the Leaf Village from the shadows.
He often gathered information and sent it via hawks back to the village to the Seventh Hokage, Naruto. Sasuke also declined the Hashirama cell arm that he was offered as a punishment and a mark of his sins.
Sasuke, at this point in time, is not a criminal. He is allowed to enter and leave the village as he pleases. There are a few reasons why Sasuke has chosen to not stay in the village.
He just doesn’t want to stay in the village since he doesn’t see himself as worthy enough to. Sasuke realized and matured enough o understand that even though his sins were pardoned, they do not just disappear.
He still deserted the village, fought Leaf Shinobi, plotted to destroy the village and to rule it as well in whatever form it may be due to whatever reason.
Sasuke wants to use his abilities of the Rinnegan to travel dimensions and as far as possible, secure the Leaf Village even before any major scale threat can be initiated against the village.
Sasuke has been involved in the fight against the Ohstutsuki for a long since Kaguya mentioned that an army was coming. Sasuke does come to the village when it is something important like Sarada’s Chunin exams or her birthday.
Also, Sasuke is in possession of the Sharinnegan and is also a widely known Shinobi. This means that he will definitely be targeted by strong enemies for his doujutsu.
He stays away from his family so as to not get them targeted or get wrapped up in this whole mess that the Shinobi world is. Sasuke doesn’t want to expose his family to any unnecessary threats.
Itachi has always been one of the biggest pieces of Sasuke’s life. From being his beloved big brother who carried him on his back to being the villain of his life to finally being the greatest hero he could ever imagine.
There’s some admiration for Itachi at play here as well. He wants to sacrifice for his village from the shadows without letting anyone know about it, just the way his brother did.
Itachi went through an extremely painful decision of choosing the village over the clan and murdered every single one of them except Sasuke who he couldn’t bring himself to kill.
Sasuke wants to honor this and wants to stay in the shadows to support Naruto in protecting the village. Thus, his moniker of Shadow Hokage.
Sasuke’s return to the village was quite a roundabout and complicated phenomenon. This could be looked at in many ways and perspectives.
If you see Sasuke’s crimes being forgiven as his return to the village since this is when the doors opened for him again, it could be said that he returned to the village after the war and just chose to go out.
But if you think about it in another way, Sasuke hasn’t and most likely will never return to the village.