The Pauli exclusion principle says electrons in atoms cannot share the same 4 quantum numbers. The fact that the electrons are in the 1st shell determines 3 of them (n=1, l=0, m_{l}=0), and there are only two possible values for the 4th quantum number (m_{s}=+1/2 and m_{s}=+1/2). Got it? Well, for principal quantum numbers higher than n=1, there are multiple possibilities for the value of the angular momentum quantum number l (l=0 up to l=n-1). Each possible value of l is associated with a sub-shell: l=0 is called the s-subshell, l=1 is called the p-subshell, and so on.
The quantum number is something you should already know about if you are asking the question in your original post . Seriously though, please look that up on wikipedia to get the basics down, then come back here and ask specific questions if you are confused.
To know that, you need to learn quantum mechanics a little bit. Sub-shells are orbitals, determined by quantum numbers in Schrodinger's equations. n is the principal quantum number that determines the shell. l has something to do with angular momentum, m is the magnetic angular quantum number. In general, l must be less than n, while m must be equal to or less than l. In the first shell n=1 as it is the first shell, l only =0. In the second shell where n=2, l=0 or 1, so m=+1 or -1 or 0. For each set of parameters there is one orbital and in one orbital there are two electrons. Thus in first shell there is only on orbital possible, thus 2 electrons. I hope this would help you with your question.