The biggest multiple side war was probably World War II. Biggest in all respects, including the number of sides.

Soviet Union started the war on the side of Germany; they jointly invaded Poland, and
Soviet Union helped Germany against the allies.

Then Soviet Union started its own war with Finland. As a result, Finland became Germany's ally, but their participation in the war with Soviet Union was very limited. The Finns took back their territory and refused in further help with the invasion of Soviet Union. 

In 1944 they switched sides and fought the Germans for a short time.

France first declared a war on Germany, then was defeated and become German ally.
There were actually two governments of France, fighting on different sides.
When Germany invaded Soviet Union, Ukrainians immediately tried to declare their independence and organized an independent army. At various times this army fought Germans and Soviets, but there was also a large scale  Ukrainian-Polish war.

Similar story was with other nations whose main goal was fighting for independence.

Some nations of Soviet Union had approximately equal numbers of soldiers fighting of
the German and Soviet sides. There was also a Russian army fighting on German side.