There is a rule for diatomic homo-nuclear species that says that if $Z<8$ then $$E(\sigma_{2p})>[E(\pi_{2p_y})=E(\pi_{2p_z})]$$ and the inverse if $Z\geq8$ and in both case we have energy of $$E(\sigma_{2s}^{*})>[E(\pi_{2p_y}^{*})=E(\pi_{2p_z}^{*})].$$
This is understandable but what if we have diatomic heteronuclear species like $\ce{NO}$ or $\ce{CO}$?
How can we determine which of the molecular orbitals $\sigma$ or $\pi$ is higher in energy? I.e. how should we know which to place below which in the molecular orbital diagram (sigma or pi orbitals)?