How are engines numbered?
The Wikipedia article is clear: engines are numbered sequentially, left to right, as seen by the pilot facing forward. That corresponds to the second of your diagrams.

Twin engined aircraft have just engines 1 and 2 on the port and starboard wings respectively.

Three engined aircraft follow the same convention with the number 2 engine in the fuselage centre line.

Since this appears to be an arbitrary convention I'm not sure what more explanation you're expecting.