It is no secret that Russia wants Turkey to take over Afrin. Presence of Kurdish groups means the presence of US. And as the Syrian government didn't have the power to take over Afrin or any of the Kurdish areas, Russia couldn't intervene. It couldn't go in there with its own forces either because that would be really bad for its internal politics. This is actually a great win-win scenario for Russia, Syrian Government and Turkey.
Russia wins by having less territories inside Syria to worry about. (Because, like I said, Kurdish presence means US presence. It would rather have Turkish presence in Afrin). Russia no longer acts like Turkey is a nato ally. It rather acts like it is an eastern bloc country nowadays. So, if Turkey has Afrin, it means less of a chance for a US-made defense system or base installed in Afrin. If somehow the US ensured the formation of a Kurdish state that stretched through the entire border of Turkey, US would have been able to have yet another ally in the area.
Syrian Government wins because it didn't need to use almost any manpower. It may look like it has lost, but believe me, in the future, if the rebels and the government somehow gets along or if they can elect a joint leader, it will have a larger territory. I also think that all those small forces that were sent to "take control of Afrin" were just a show. They wanted to show Turkey that if it decides to go further than Afrin, they may start a real war. (They can't afford that anyway so it was just the smallest bluff maybe).
Lastly, of course it is a win for Turkey as it clears its borders from these terrorists groups, injects its presence into a much larger area (which will mean a bigger bargaining chip on the table for Syria's future), ensures that a Kurdish presence can never reach the coasts (and consequently, land locks a possible future Kurdish nation), forces US to perhaps realize its real allies.
I think that, the real question is, will we actually give all of these sides what they want? Russia and Syria probably assumes that one day, they will get back these areas. But already, we have too many investments in these terrains. So consequently, I don't think that we will actually give them back. I actually believe that one day, in like 10-15 years when all of this crisis blows out entirely, there will be elections to add al-bab and Afrin into Turkey. Syria will be still weak enough to make any counter moves against that. We may, in the future, see Afrin as the 82nd province.
note: I should point out that this is solely my analysis of the situation. I'm not a military tactics expert.