According to Pauli's principle, within an atom no two electrons can have identical sets of all four quantum numbers. Each orbital is defined by a specific arrangement of the first three quantum numbers (n, l, ml), allowing only two electrons to occupy a single orbital—one with ms = + 1/2 and the other with ms = -1/2. Consequently, the K shell (n = 1), which has a sole arrangement of n, l, and ml (i.e., one orbital), can hold a maximum of 2 electrons.
This also means that the shell with 4 orbitals can accommodate up to 8 electrons.
Orbitals are categorized as follows: s (max 2 electrons), p (max 6 electrons), d (max 10 electrons), and f (max 14 electrons).
As you progress through the orbitals, each gains an additional "l" number.
The highest capacity for electrons in a specific energy level is determined by the formula 2 n^2.
Returning to the question, for n = 5, the associated layer is "O," which, along with the levels beneath it, can accommodate 50 electrons.
For n = 2, the relevant layer is "L," including the lower "K" layer, which can together hold 8 electrons (2 + 6 electrons).
In terms of n = 3, for L = 0, it relates to the first subshell with 2 electron capacity.
For n = 3, L = 1, this corresponds to the second subshell holding 6 electrons.
In the case of n = 3 d (linked to l = 2), the corresponding layer "M" can accommodate 10 electrons.
Regarding n = 2 s (linked with l = 0), it allows for 2 electrons.
For n = 5 f (associated with l = 3), it allows for 14 electrons.