To have a maximum of 500 troops you must have Command researched to level 10, this is located within the military tree of research.
If Command is researched to level 10, this doesn't not mean 500 troops can be placed in a players village. This number is affected by the amount of other units you have created, which use up unit space. Scouts and merchants will use 10 unit spaces each while monks will use 25 unit spaces.
See Units for further information : http://help.strongholdkingdoms.com/index.php/Units
Using a Vassal will allow you to have a second army of 500 troops: