Short answer, read the manual ! Long answer....
Right then, the way to do it is to get yourself a great leader. How do you get a great leader? Whenever one of your elite combat units wins a battle (attacking or defending) there is a small chance (about 5% or so) that a great leader will spontaneously appear.
Once you have a leader you have two choices. First send him to a city and use him to build an improvement in 1 turn (including wonders!) or second use him to make the army. Select option 2 and then move other units to the same location and 'load' them into the army. You can have a maximum of three units on an army
A couple of cautionary notes. Firstly, the ability of a great leader to build a wonder in one turn means that many players would never even consider making them into armies. Personally, I use the first two or three leaders as builders but I will eventualy use one for army creation. Secondly, once a unit is in an army, it can never be upgraded, so after a while the army becomes obsolete, so be wary!
On the upside, if you DO make an army and it then wins a battle, you have the option for three small wonders. Firstly, the heroic epic which increases your chance for an elite unit to create a leader. Secondly, the military academy which allows you build 'armies'. These are exactly like the great leaders except you can only use them to make more armies. Finally, you can eventually build the pentagon, which allows you to put four units into your armies making them even tougher.
Why have armies? Well, when they attack one unit will attack first but then retreat when reduced to 1 health. The next unit then steps up to attack the same defender. This continues until one or the other is dead as normal.
Phew!