Jerome, or Ivy, it would be easier if you have follow-ups with the original post. If you think someone forgot about you, make a new post with reference to the old. This way there will be better continuity. Thank you.
Follow-up answered in original post:
I know that 1s2 2s2 2p1 is the excited state of 1s2 2s2 but then 1s2 2p1 its orbital are filled out of turn. So I am kinda confused about it because you said that if its excited state then that means its not ground state and if the orbitals are filled out of turn then that's not in the ground state too. So does it mean that b and d are both not in ground state?
"I know that 1s2 2s2 2p1 is the excited state of 1s2 2s2"
1s2 2s2 2p1 (Boron) has 5 electrons, and 1s2 2s2 (Beryllium) has four, so they don't belong to the same element.
The ground state and excited states (of the same element) should have the same number of electrons.
For example, the following are both ground states:
Be 1s2 2s2 (4 electrons)
B 1s2 2s2 2p1 (5 electrons)
For elements with small number of electrons, "filling out of turn", position-wise, is a good guide.
As the number of orbitals increases, sometimes filling an outer orbital requires less or similar energy than completing the remaining shell. For example 4s² would be filled before 3d10 because it takes less energy to do so.
If you'd like all the details, you can go through your textbook, and if you do not have one handy, try: