The way he won is very rare, but if he hit one 7 (3 outs) he beated you too.
You only have a medium/small pair and 2 outs (without count possible stright or flush outs) to improve your hand.
He is a donkey, but finally he obtained that you played the game that he wanted.