The linear combination of atomic orbitals to form molecular orbitals takes place only if the following conditions are satisfied:
The combining atomic orbitals must have the same or nearly the same energy. This means that 1s orbital can combine with another 1s orbital but not with 2s orbital because the energy of 2s orbital is appreciably higher than that of 1s This is not true if the atoms are very different.
The combining atomic orbitals must have the same symmetry about the molecular axis. By convention z-axis is taken as the molecular axis. It is important to note that atomic orbitals having same or nearly the same energy will not combine if they do not have the same symmetry.
For example, 2pz orbital of one atom can combine with 2pz orbital of the other atom but not with the 2px or 2py orbitals because of their different symmetries.
The combining atomic orbitals must overlap to the maximum extent. Greater the extent of overlap, the greater will be the electron-density between the nuclei of a molecular orbital.