Why did Russia leave the war in 1917?

1: Russia was defeated by Germany.

2:Russia was defeated by France

3The Russian tsar negotiated a separate peace with the United States.

4:Tsar Nicholas II abdicated, Russia went communist and signed a peace treaty with the Central Powers.