When one or both sides decide they want to win more than the other side. Total war is about setting your priorities. if your priorities include winning, and you want to win at whatever cost, then will be fighting a total war. The characteristics of a total war include the war taking up a large portion of a belligerent's resources, massive casualties, massive collateral damage, and often massive civilian casualties. World War 2 was a total war, because nobody cared about the cost in both civilians and military personnel, and they focused large portions of the economy into the war effort. the wars in Iraq and Afghanistan are not total wars because they are not priorities. the military is also far more concerned with the well being of the civilians that live there than they are about defeating the terrorist threats (because we are there to protect civilians).
Total wars are very effective and can shorten the length of the war by several years. examples include World War 2 (5 years) compared to Afghanistan (10 years). however, Total War was worth its cost in world war 2 because the United States was fighting an enemy that was fighting without any consideration of casualties on either side, so the sooner it was ended the better off everyone was. this is not effective in Afghanistan because there wouldn't be much of a civilian population left to protect afterwards.