Hi, hopefully I can help!
When n=1 ( Principal quantum shell 1 ),
there is 1 s-subshell which can hold 2 electrons.
When n=2, it contains the 2s and 2p subshells! Like you've stated, the p-subshells have 3 orbitals, namely 2px, 2py and 2pz. Each orbital can hold 2 electrons. Thus the p-subshell can hold a maximum of 8 electrons, 6 from the 3 p-orbitals and 2 from the s-orbital.
When an atom has an electronic configuration of up to n=2 ie. it has 2 electron shells, it mainly means that it can hold a maximum of 10 electrons( 2 from n=1 and 6 from n=2). Any more will go to the next energy level/principal quantum shell 3.
At n=3, it contains the s,p and d subshells. d-subshells have 5 orbitals, and thus d-subshells alone can hold 10 electrons max. Now, don't forget the s and p subshells, so at n=3, a total of 18 electrons can be held.
Any atom that has a d-sub-level ie. up to n=3 can hold a maximum of 30 electrons.
If you add it all up, where n=3 has 18 electrons, n=2 has 8 and n=1 has 2, you'll get 28. But if you've reached the part about the 4s subshell being lower in energy than the 3d subshell, that gives you an additional 2 electrons, which was how I got the 30 max.
Basically, the biggest is the electron shell and then the sub shells and orbitals, the smallest.
As your electron shell number increases ie. n=1, n=2 etc, the number of subshells you have within your electron shell increases too, eg n=1 has only the s subshell, n=2 has the s and p sub shells. The orbitals are within the subshells, and their numbers are standard, s subshell has 1 orbital, p subshell has 3 orbitals, d subshell has 5 orbitals and f subshell has 7 orbitals.
Hope this helped. It was confusing for me at first too.