Complex sentence: The group was not allowed through, and the French opened fire on the civilians, who turned back to the castle for safety, but found the gates locked.
Split into simpler sentences: The group was not allowed through, and the French opened fire on the civilians. They turned back to the castle for safety, but found the gates locked.