Below are the different strategies against the Caliph.
For his slave raids, several groups of archers or horse archers are needed to protect outlying buildings.
A good number of crossbowmen on walls will easily deal with the troops that the Caliph sends on his main attacks, even his horse archers, which tend to rather foolishly remain stationary (unlike those of Saladin) and his Arabian swordsmen (which die easily to crossbow bolts). Hostile fire ballistae and catapults will be tougher to destroy without the use of tower mounted ballistae. A group of horse archers are useful (once his own horse archers are dead) to sally out from your castle and destroy the catapults. Move them from side to side in range of the enemy siege equipment to avoid getting hit by the fire ballistae.
The best attack strategy would be to use trebuchets placed just close enough to his walls to smash them down, and tunnelers undermining his walls from below. A small wave of macemen should then rush ahead of the main attacking force (which should consist primarily of swordsmen and pikemen, and miscellaneous siege equipment) to ignite the pitch. After the walls have fallen, the heavily armored swordsmen and pikemen should be sent in to storm his keep. The keep will likely contain fire throwers and/or burning oil engineers, which pose a major threat to slow moving troops. If you can’t kill them first with ranged troops, send in a second small wave of macemen to activate the boiling oil before finally storming the keep.