For the legendary quests, generally you want to constantly build villagers and caravans (workers) until they're well over half your population cap., then splurge on upgrades and attacking units ("boom") until population cap., then delete workers down to desired pop. for a final max. So yes, you want to hit Age 2 to build a market/TC as soon as possible, but the build order depends on what starting resources and tech. are. I usually hike worker pop. up to 120-140, spawn attacking units up to 200 cap., delete worker pop. back down to 50-60, then max cap. again.
For the Halloween quests, we start with an ample amount of resources. I believe Bring Out Your Dead is the only one where we start below Age 2, in which the first action I take is to upgrade to Age 2 on that particular quest. Except for the aforementioned one and Paint the Town Dead, my general build order (note there will be some variation between civilizations) order is:
Norse, Greek, and Celtic:
Queue first 5 initial villagers to build one or two markets, TC near trees, then harvest wood. Continuously spawn and rally 10-16 vills. out of first TC to berries, redirect some (4-6) to harvest huntables/build storehouse if available. Pull 1-2 villager off berries to build wall/towers. Out of first market, spawn one caravan and queue Age 2 market upgrades. Exchange gold for resources as needed to get said upgrades as well as those for storehouse and walls. Continuously spawn and rally workers out of second TC to harvest wood. Rally the the next 5-10 villagers out of first TC to harvest stone deposits, then rally the remaining spawned villagers from this TC to gold or wood. Continue exchanging gold for resources to continue queueing workers to desired pop. Build another market(s) when you have an ample queue in your markets and TCs. Queue one or two villagers off wood to build housing until maxed. Upgrade to Age 3 as resources become available, queue storehouse upgrades as they become available (don't queue any upgrades for resources that you are not harvesting, obviously). Build farms after berries/huntables are exhausted (I usually end up with 20-30, depending on how food intensive my attacking units). Once desired worker cap. is queued on your TCs and markets (I sometimes end up with 40 in queue, not good), pull 10-20 villagers off wood and queue them to build 3-4 Blacksmiths, any other buildings that upgrade attack units, and your attack unit buildings themselves, usually 10-30. Queue upgrades as soon as resources will allow. Then "boom".
Egyptians:
Generally the same except I will spawn priestesses to empower each market and active TC (5 usually). Use your villagers on wood to build temples to advance ages. Move priestesses to empower attacking unit buildings once worker cap. reached.
Some pointers:
-Use hotkeys. Putting your TCs, markets/docks, upgrade buildings, and Attacking Unit Buildings on their own hotkeys helps a lot in letting you queue units up without excessive camera movement.
-Build the second TC near stone/berries simultaneously next to wood if possible.
-Keep building storehouses near treeline as needed to cut down on running time for your villagers. This also helps you spread out upgrades.
-Minimize your queue times by spreading out upgrades across buildings. For instance, queueing 4 storehouse upgrades simultaneously across 4 storehouses instead of queueing all of them on one. Or advancing to Age 2 in one TC and upgrading villagers in another instead of queuing them all on the same TC.
-Villagers on wood are generally the pool you pull from to build walls, towers, and help with any early harassment in general.
-Use house walls, towers, fortresses, and spawn units from your first attacking unit building to ward off early harassment until you can boom your main army
-My build order generally avoids some of this, but you don't want to overbuild and have idle productions buildings that you can't queue units out of for lack of resources. That's lost harvesting and queueing time. Like building multiple markets at the start and forgoing the TC and having no wood to queue up caravans.
-150g is the carrying trade capacity for caravans, any distance travelled once trade capacity is reached is wasted. If you don't already know the optimal place to build your market, Display Trade Preview hotkey under Building Construction Hotkeys can help a lot with this. I have this key bound to the same one as the market.
I don't know if this is optimal, but it's good enough at least with a partner to beat all of the Halloween quests and many other Leg. quests. There have been other posts on this topic if you do a general search.