Legion is a Gestalt Entity, which means he is made up of many invividuals melded together to form one. He has a habit of popping up when he is least expected, which made him good friends with Wizzy Wizard .
Legion got his name from the Geth also known as Legion. The Quarians raided a science facility on which the Gestalt was being created, in their endless trek for jobs. Typical of Quarian stupidity, they accidently drained the atmostphere of the facility, killed everyone aboard. The Gestalt was left aboard for many years until the Quarians brought aboard a renegade Geth known as Legion, and his conciousness was extrapolated by the Gestalt.
After being in the form of Legion for that long, the Gestalt began to refer to himself as Legion, even after the original Legion had gone and he was reduced to a swirling mass of nothingness.
Centuries later, Legion was visited by the crew of the Mining Ship Red Dwarf , and tried to make them stay with him in order to retain his form. However, his plan failed when the crew knocked each other out to render themselves unconcious, unitl only their bumbling service droid remained. Legion took his form and shared his brain waves, therefore sharing his desire to get the others back to Red Dwarf and allowed them to leave, becoming a nonexistant entity once more.