As in defending, the organisation and the number of players needed must be decided but above all, the coach depends on the material he has. It is his philosophy and quality of players he has.
The idea is that the arrangement should shape well in defending first. Once that is sorted, the attacking option is taken into account.
Going forward, also think about how many players you want in the attacking movement. These midfielders behaviour is critical in the transition, or when the ball changes hands (feet).
As a coach deploying a defensive structure, you give yourself an outlet by setting up for a chance to hurt the opponent by sudden speedy attack once the ball is won.
Midfielders then need to move into offensive positions quickly and effectively. The disguise, creativity and improvisation elements distort the team shape in order to destabilise the opponents and take them out of the best defensive positions.
In all this, remember to close down the spaces behind, or channels on the side or corridors in the middle to avoid the opposition breakthrough. Carelessness in this instance will be counter productive and concentration levels must be high.
Always have a very good defensive shape when attacking. All players need to remember at all times, that when attacking, they will have to defend when the ball is lost and that when defending, they will have to attack when the ball is regained.
the midfield shifting is as important as in defence. The wide players must be able to tuck into central areas when the ball is on the opposite wing or channel. This channel is called the strong channel.
intelligent play will detect that there is always have a ready outlet, usually on the weaker channel. In this case, it must be a very quick player who can run with the ball or dribble.
As soon as the ball is won, switching play diagonally across into space will force defenders to play facing their goalkeeper, a nightmare in any game at any level.
Let me say that many South African coaches prefer two central midfielders, with one more offensive and the other defensive. They alternate their movements forward all the time.
I personally prefer that both stay, and I have three coming back to receive the ball, turn and join the striker to attack.