TE’s M12 connector is one of your options for reliable sensor connections in Industrial Machinery and Factory Automation. There are 4 pin arrangement options for the “M12 Receptacle, PCB assembly, Angled, Shielded, A-code” style of connector namely as below
If you are looking at the datasheet, TE shows the five-position pin assignment with its recommended PCB layout.
For the two, three, and four pin arrangements, you can refer to TABLE 2 of the datasheet,
On the diagram:
The icon means there is a physical pin available
The icon means this position is empty.