At the beginning of the battle, there are a total of six officers attacking the Shu forces surrounding and inside the castle. Clear out all of them, including the two inside, who are Xiahou Dun and Xiahou Yuan. Once it's clear, go to the central area, where you will be thrown against a lot more officers, including Yue Jin and Li Dian.
You will need to defeat the above two in order to gain control of the ballistae, so do that. Around this time, Zhang Liao will begin preparing a boat to leave from the northeast corner. You need to head to the area in the north part of the center of the map, defeat Han Hao and use the catapult to try and destroy the boat.
If you fail, then you have to deal with Zhang Liao who lands near Baidi Castle. Also, some Nanzhong reinforcements are set to appear from the south, but Wang Yi shows up and blocks them. Defeat her to make your reinforcements show up, then continue along the southern path towards Cao Cao's main camp. You find out the main gates are shut and you will need to navigate through some bases to get inside.
There will be a few generic officers in the way, but the big ones appear inside of the three bases you need to take. The first one has Cao Pi and Zhenji, with the second having Pang De and the third being occupied by Guo Jia. Make your way into the main camp, where you'll find Cao Cao being guarded by Dian Wei and Xu Zhu. Defeat Cao Cao to finish the battle.