For H$_2$ there are only two electrons and thus you can only have singlet (electrons with opposite spin projection) and triplet states (electrons with equal spin projection).
The spin wave function of the singlet state is a linear combination (a superposition state) of the first electron with spin projection $\alpha$ and the second electron with spin projection $\beta$ and the opposite situation. Both spin states in the quantum superposition have opposite phase:
$$|\uparrow\downarrow\rangle -|\downarrow\uparrow \rangle$$
If the electrons are in the same molecular orbital then (by the Pauli principle) only the singlet state exists. If they are filling $\pi$ molecular orbitals then they could be in different degenerate orbitals (with angular momentum projection on the molecular axis $M_z = \pm \hbar$) and thus both singlet and triplet terms would exist.
There are three degenerate states belonging to the triplet term, that is, there are three wave functions that have equal energy. There spin components are:
$$|\uparrow \uparrow \rangle$$
$$|\downarrow \downarrow \rangle$$
$$|\uparrow \downarrow\rangle + | \downarrow\uparrow \rangle$$
So you can see that it doesn't matter if you fill one molecular orbital with one electron in spin $\alpha$ and a different molecular orbital with the electron with $\alpha$ spin or you do so with both $\beta$ and $\beta$ spins. However you can not put both electrons with the same spin projection in the same molecular orbital. That is against the Pauli principle, that is, against the anti-symmetry of the electronic wave function.