The principal quantum number represents the potential energy of the electrons at n position. n can be 1 and higher, the lower n is, the closer the potential energy is to the nucleus of that atom.
The formula n2 allows you to calculate the number of orbitals at a specific energy level (principal quantum number).
Since each orbital can contain an up spin electron and a down spin electron, each orbital can hold two electrons. This gives us the formula 2(n2) to calculate the maximum number of electrons within a certain principal quantum number.
So for a):
There is 1 orbital. 12 = 1.
There can be a maximum of 2 electrons when n = 1. 2(12) = 2.
Hope this helps!