For atoms other than hydrogen, each subshell within an energy level has distinct energy. For hydrogen, however, all orbitals within an energy level are degenerate (have the same energy). So, when the electron of a hydrogen atom gets excited from its ground state to a higher energy level, can it occupy any of the orbitals within that energy level? For example, if the electron of a hydrogen atom gets excited from n=1 (only has the 1s orbital) to n=3 (has 3s, 3p, and 3d orbitals [9 total orbitals] which each have the same energy associated with them), to which orbital does the electron go?
There are rules called selection rules that determine the final state of the electron. The derivation is somewhat complicated. But effectively, these rules enforce conservation of angular momentum for the whole system: The initial angular momentum of the atom plus the incoming photon must be equal to the final angular momentum of the excited atom. Photons always have $l = 1$, so that means that the angular momentum quantum number of the atom can change by $1$ at most. It also turns out that because of parity symmetry, $l$ must change by 1; it can't stay the same when the photon hits.
In particular, if a photon hits a hydrogenic atom in the ground state ($l = 0$) then the final state must have $l = 1$ as well. This would mean that the atom must end up in the one of the $3p$ states (or some superposition thereof.)
Transitions to states that violate this rule ($|\Delta l| = 1$) are called forbidden transitions. Confusingly, this doesn't mean that they never occur; it just means that they occur much much less commonly than the "allowed" transitions.