A p orbital can hold a maximum of two electrons, and since there are three p orbitals available at each energy level, the entire p subshell can accommodate a total of six electrons.
A p orbital can hold a maximum of two electrons. However, because there are three p orbitals (px, py, and pz) at any given energy level, the p subshell can hold a total of six electrons. Each of these three orbitals is degenerate, meaning they have the same energy level, and can be filled with two electrons each, following the Pauli exclusion principle and Hund's rule. Hund's rule states that every orbital in a subshell is singly occupied with one electron before any one orbital is doubly occupied, and all electrons in singly occupied orbitals have the same spin.
For example, in the case of boron, which has an atomic number of 5, the first two electrons fill the 1s orbital, and the next two electrons fill the 2s orbital. The fifth electron then goes into one of the 2p orbitals, as indicated by the notation 2p¹ (read 'two-p-one'). If we were to consider four electrons in a p subshell, it would be notated as 2p⁴ (read 'two-p-four').