I think Irvine was a student at Galbadia who hadnt yet passed when Squall and the team arrived, but he was sent with them because of his sharpshooting ability which must be rare in the world of FFVIII. After the shooting he just stuck with Squall and carried on from there