Here "Judah" represents the soldiers in the army of Judah. Alternate translation: "When the soldiers of Judah looked back" (See: [[rc://en/ta/man/translate/figs-metonymy]])
The word "fighting" can be translated as a verb. Alternate translation: "the army of Israel was fighting them from the front and from the back" (See: [[rc://en/ta/man/translate/figs-abstractnouns]])