The men would be the old and infirm: the women those whose husbands and protectors had perished in the wars (e. g. Jeremiah 41:10). The word children includes all the inferior members of a household.
Related Commentaries of Jeremiah 40:7
Jeremiah 40:7
7 Now when all the captains of the forces which were in the fields, even they and their men, heard that the king of Babylon had made Gedaliah the son of Ahikam governor in the land, and had committed unto him men, and women, and children, and of the poor of the land, of them that were not carried away captive to Babylon;