# before them ... they went after ... they were drawn away

The words "them" and "they" here refer to the army of Ai.

# they fled ... go after them

The words "they" and "them" here refer to the army of Isreal.

# All the people who were in the city were called together

This can be stated in active form. Alternate translation: "The city leaders called all the people in the city together" (See: [[rc://en/ta/man/translate/figs-activepassive]])

# All the people who were in the city

The writer speaks in a general way about all the people, but "all the people" refers only to those who could fight. Alternate translation: "all the people in the city who could help chase the army of Israel" (See: [[rc://en/ta/man/translate/figs-hyperbole]])