Molecular orbitals are filled in the same way as atomic orbitals: lower energy orbitals are filled first, with each orbital having two electrons. In this case, the electrons that are used to fill the energy level diagram are from both of the atoms in the bond.