The number of seats is the key. 76 needed to form a government.
Simple to stick to this number when thinking things through.
The incumbent PM has first chance to form a government. If they can survive a no-confidence motion in the House then they remain PM. If not, they and their whole government by convention resign. Then it's up to the opposition leader to try and do the same thing.