As per the Bohr's atomic model, Bohr named by using symbols the first orbit (main shells) which is very close to the nucleus as K, then the second orbit as L vice-versa.
First energy level (first orbit), n = 1. Symbol: K
Second energy level (second orbit), n= 2 Symbol: L
Third energy level (third orbit), n= 3 Symbol: M
Fourth energy level (fourth orbit), n= 4 Symbol: N
Fifth energy level (fifth orbit), n= 5 Symbol: O
Sixth energy level (sixth orbit), n= 6 Symbol: P
The formula for maximum occupying in a particular shell
If we use the 'n' values ( n= 1, 2, 3 ...), we can get the maximum number of electrons which occupy in a particular orbit (shell).
For the first shell (K), n=1, so the maximum electrons = 2 (1)^2 = 2 electrons
For the second shell (L), n =2, so the maximum electrons = 2 (2)^2 = 8 electrons
But it
does not decide how many electrons can fill minimum.
For example Hydrogen atom, the K shell has 1 electron.
Boron atom, the K shell has 2 electrons and L shell has 3 electrons.