Experienced Pike and Shot scenario designers need to be aware that FoG2 is slightly different in this respect, because in P&S there was usually no need to organize the player side army into teams. In FoG2 you need to do this because it will allow the player to move his/her teams using the Move Whole Command feature.
So, click on the “Open Custom AI Data Dialog” button:

The “Scenario AI Data” sub screen pops up:

The first field is for “AI Team”. Each armies units can be allocated to a team, there are a maximum of 8 teams (numbered 0 to 7). All units are allocated to team 0 as a default, but we will nearly always want to change that to allow more complex AI orders.
So looking at this particular scenario, we want to allocate the left flank cavalry to a team, and order them to advance against the opposing Macedonian cavalry. First thing we do is change the “AI Team” value to the team number that we want to allocate. So click on the right arrow to make the value Team 1, and then click on each unit on the map that you want in that team. The label on each unit changes when you have successfully allocated it, from FIXED:TEAM 0 to FIXED:TEAM 1.

We then need to set the “Aggression” value. This is a numerical code that defines the team’s behavior. If you click on the “?” button at the top left of the “Scenario AI Data” it brings up a scroll that explains what the Aggression values mean:

The values can be added together to give more complex orders. For instance if we want the team to attack only enemy cavalry we would add 16 (seek and destroy) + 256 (ignore foot, unless close) + 2048 (ignore artillery) to get a total of 2320. So lets add 2320 into the “Aggression” value field using the arrow keys. You can hold down the SHIFT key while clicking to advance by 10 to make things quicker.
We can define a target point for that team to advance towards using the “Target AI Point” field. The default value is None, but for this particular team I have changed it to Target AI point 1 by clicking on the arrow:

Then click on the “Cycle AI Point to use” button, so that it shows the same value as the Target AI point number that we have chosen, in this case 1.

Then click on the button on the opposite side of the sub screen called “Set the place of the current AI point on the map”.

This allows you to click on the map in the square that you want to set the Target AI Point. An inverted yellow pyramid will appear on the map when you mouse over it, to indicate that you are in Target AI Point placement mode. Just click wherever you want the Target AI Point to be set. In this case, I have set it some way beyond the Macedonian cavalry. Once clicked, it is always displayed on the map while the “Scenario AI Data” sub screen is up.

You repeat this process for all the other teams that you need. When you have finished just click the “Close” button on the “Scenario AI Data” sub screen.
Player side units are allocated to teams in exactly the same way, you just need to keep the CTRL button pressed while clicking on the units. Of course you do not need to set Aggression values and Target AI Points for the player’s units so just ignore those values that are on the sub screen, they only apply to the AI side teams. Remember, you need to allocate the players units to teams to allow the “Move Whole Command” function to work during play.
Tips:
The AI seems to move it's units in Team order, so just bear this in mind when numbering your teams. If you have teams lined up behind each other on the battlefield, you will normally want the team at the front to move first, otherwise the units behind will move first and get in the way of the units that were in front. So have the team in front numbered lower than the teams behind. In my Elephant Victory scenario I deliberately did the opposite of this. In that battle the Galatian Chariots were deployed behind the infantry. At the start of the battle, the infantry opened ranks and let the chariots through to make their attack. So I left gaps between the Galatian infantry, and numbered the Chariot team lower than the infantry teams, so that they moved first. I also used a script to delay the infantry advance, but that's something I will show you how to do another day!