That's another problem ... when fighting a non-governmental or quasi-governmental, irregular-force opponent ...
What is a civilian? Is a 10 year old wearing a bomb-vest a civilian? Is his mother, who dressed him in a bomb-vest, a civilian?
The old philosophy, if bullets are coming from direction A, then whatever is in direction A is the enemy. If the enemy is using unwilling human shields, you do what you can, if possible to protect them, however, not at the expense of your own troops or civilians. If the shields are willing participants, they are a target no different than any other soldier.