This has only become the case officially after WWII.
And frankly I think the only reason this even matters is the media.
Civilian lives meant absolutely nothing and were considered fair target during war.
Millions died in WWII from intentional fire bombing campaigns on urban areas by the allied forces.
Same in the Korean war.
Same during the Vietnam war.
Civilians were purposely targeted to "demoralize the enemy" and force them to surrender.
The official difference between war and terrorism is that war must be officially declared by a government and have specific objectives and once the objective is reached then the killing should stop.