Take the sum of all the congregation. This was certainly not commanded with a view to the war against Midian, which was of no military importance, and was actually prosecuted with no more than 12,000 men (Numbers 31:5).
A general command to "vex the Midianites" had indeed been given (Numbers 25:17) on the principle of just retribution (cf. 2 Thessalonians 1:6), but no attempt seems to have been made to act upon it until a more specific order was issued (Numbers 31:2).
In any case the present mustering has to do with something far more important, viz; with the approaching settlement of the people in its own territory. This is clear from the instructions given in Numbers 26:52-56, and from the distribution of the tribes into families.
From twenty years. See on Numbers 1:3.