Nicholas II abdicated in March 1917, shortly before Wilson asked Congress for a declaration of war against Germany, but the Russians stayed in the war until after the Bolshevik takeover in November 1917. Lenin's treaty with Germany was in the spring of 1918.
The Russians for all intents & purposes stopped fighting when the Tsar’s government fell; troops left the front lines, and there was no cohesive plan any more for continuing the war. Wilson knew the Allies were doomed, and propped them up. Between the effectiveness of the U-boat campaign, and the fact that a million German troops from the eastern front could now be brought west, there was no doubt that the Central Powers would win.