The Union of Soviet Socialist Republics was formed in 1918 by Vladimir Lenin, after a revolution in October. After the first revolution in 1917 a provisional government was installed, of which the old tzar, Nikolai II, refused to lead. Lenin's Bolshevik Party later took power and formed the RFSFR. Soon after, the other nearby states joined in to form the USSR (CCCP). Lenin was shot 3 years later, but survived.
This amazed his followers, but he fell ill and died soon after. His controversial General Secretary, Joseph Stalin, managed to take over while technically not rising in rank. In 1937 he began the Great Purges, which were supposedly done to remove "traitors to the Motherland and people with counter-Revolutionary ideas". In reality it was an attempt to remove his rivals. Later he secretly signed a pact with Adolf Hitler to split Poland between them in 1934.
However in 1941, Hitler broke the pact and began Operation Barbarossa, the largest military operation in history. After suffering numerous defeats and taking immense casualties the German offensive was halted by the Russian winter. Further offenses were conducted in the spring of 1942 but by this point the Red Army had been reinforced and famed general Georgii Zhukov introduced better tactics learned from fighting the Japanese several years prior. The Germans failed to take Moscow, Leningrad, and Stalingrad, their main objectives. Notably at Stalingrad the Wehrmacht suffered massive and irreplaceable casualties and would be seen as one of the major turning points of the war. Germany attempted to gain the initaitive once more at Kursk but the attack failed and Germany would be on the retreat for the rest of the war. In May 1945 Berlin was captured and Germany surrendered. The Soviet Union then attacked Japanese territories and captured numerous areas before the Japanese surrendered.
After the war the Soviet Union and the United States became rival superpowers starting the Cold War which lasted until the Soviet Union was dissolved in 1991 by Boris Yeltsin.