When atoms ionized, electrons tends to stay at whichever orbit confirmation that would allow them to obtain the most stable form.
you may wonder what do I mean by "the most stable form". An atom is at its most stable form when it has a filled orbit. it has a tendency to gain or loss electrons till it reaches such state. Therefore, "p" orbital does not always take on new electrons and "s" orbital does not always take the loss.
you are correct about your example

the electron configuration for Mn is [Ar] 4s2 3d5
this is the most stable form Mn can be in, a full "s" orbital and a 1/2 filled "p" orbital
now let's take a look at Mn+2
if you are to loss 2 electrons which confirmation do you think will be more stable?
1. [Ar] 4s0 3d5 where you have no "s" orbital and a 1/2 filled "p" orbital
2. [Ar] 4s2 3d3 where you have 1 filled "s" orbital and a 3/10 filled "p" orbital
ans: a 1/2 filled orbit is more stable than a 3/10 filled orbit, therefore #1 will be your choice
similarily for Mn+3
the electron configuration is [Ar] 4s2 3d2 because that will give you a filled "s" orbital and 1/5 filled "p" orbit, which is more stable when compared to [Ar] 4s0 3d4 where you don't have a filled "s" orbit nor a filled "p" orbit.
I think you got the general concept of how atoms are being ionized, and i hope my explaination is making sense to you
let's look at valence electron now
valence electron is defined as the electrons located within the outermost shell/orbit of an atom.
In this case, the outermost orbit for Mn is the "d" orbital, it has 5 electron in it, and therefore the valence electron is 5
the gaining and lossing electron gets confusing with transcition metal because you can gain or loss electron from both "s" or "d" orbital depends on the stablitiy of atom.
I hope this explaination will help a little bit~!

"Changing the world one enzyme at a time"
http://enzymatic-clothing.tripod.com/