First of all, Putin is not leaving Syria. He’s probably removed a few planes. That’s all.
Second, he’s basically won the war. Putin’s guy survived, and he’s convinced Saudi Arabia, Turkey and Obama, through brutal use of power, that their destructive, Sunni proxy war is doomed to failure.
Putin Carried Out Threat to Assad and Withdrew Forces: Louay Hussein
http://syrianobserver.com/EN/Interviews/30727/Putin_Carried_Out_Threat_Assad_Withdrew_Forces_Louay_Hussein/
The cost of the war was minimal for Russia. It may even have gotten a net profit from it if Iran paid the bills. The war in Syria was a pipeline war fought along sectarian lines.
Russia got some fine practical field experience and testing of operations and equipment.
Kind of bomba testing 1.0.