New Main Objective: Meet the men outside Fort Kastav
Note! You get this mission during the Reunification of Skyrim main Imperial Legion Quest and its completion is required to advance to the next part.
You'll see on the world map that the scouts have placed themselves at some distance from Fort Kastav (the above screen). The fort itself is located northwest of Windhelm and it's there that you should start your journey from, reaching the scouts from the south.
When you meet them, talk to the scout's commander, Hadvar (the above screen). Ask him about the plans for rescuing the prisoners. The Legionnaire tells you that there is a grate on the outside of the wall, which you can use to sneak into the prison. After the prisoners have been rescued, Hadvar suggests meeting his men at the courtyard to get rid of enemy soldiers. Whether you agree to his plan or decide you're not too good with sneaking doesn't matter, especially since getting to the grate doesn't require higher than the average thieving skills.
New Main Objective: Sneak into the fort
Before you do anything, wait until the night to lessen your chances of being accidentally discovered by one of the sentries. Move towards the fort, going east in a straight line (the above screen).
After several meters, I suggest crouching or at least slowing down so as not to be spotted nor heard. Turn northeast and try to get as close as possible to the wall (the above screen).
Once you're by the wall, stop and turn south. Head towards the grate marked by the game (the above screen) and use it to get into Fort Kastav Prison.
New Main Objective: Free the prisoners
Labels on the map: 1 - secret prison entrance; 2 - corridor leading to cells; 3 - probable whereabouts of a guard with the cell key; 4 - cells with the imprisoned Legionnaires; 5 - route to the main courtyard.
It's better to sneak here as well, though even if you're spotted, you don't have to worry that the guards from the courtyard will come here. Open the closest door and go past the larger room, heading east (the above screen).
After a while turn south and prepare to take out the first guard, who should be patrolling the area of the stairs (the above screen). It's better, of course, to surprise him.
Go south. The second guard is near the cells holding the Legionnaires (the above screen). If you haven't spoiled it earlier, you should be able to surprise him too.
There are three imprisoned Legionnaires here (the above screen). You can open their cells by lockpicking (poorly secured locks) or examine the body of the second guard to take the Fort Kastav Prison Key.
New Main Objective: Take over the fort
Free all three Imperial Legion Legionnaires and wait until they run towards one of nearby chests to recover their equipment (the above screen).
You now have to return to the north room of the prison, killing one guard on the way. When you get there, save the game first and then go through the north door (the above screen) leading to Fort Kastav's inner courtyard.
If your character specializes in close combat, you can attack the Stormcloak soldiers at once. Don't worry about the freed Legionnaires, because even if they die during the fight, you won't suffer any punishment for it.
If your character prefers ranged combat, I suggest getting to the left wall as soon as you leave the prison, and taking a good observation spot from which to eliminate the Stormcloak soldiers (the above screen).
Watch for a larger group that will come from the northwest (the above screen). It's best to use an area-effect attack on them, for example the Unrelenting Force Dragon Shout. This way you can stop their massed attack, but it also gives you a few moments of peace before the allied scouts arrive.
This battle differs from the others in that no new enemy soldiers appear of the battlefield. You need to eliminate "only" those soldiers who are marked by the arrow from the start. Fight until everyone is dead (the above screen).
New Main Objective: Report back to Hadvar
Find Hadvar, who, depending of how well you dealt with the foe, can be inside the fort or on his way to it. Listen to his short commentary (the above screen). This mission is now over, so you can return to completing the Reunification of Skyrim (main objective: Report to General Tullius #4).