The sentence with the correct pronoun and antecedent agreement is:
"While the students were getting candy from house to house, they argued about who had the best costume."
In this sentence, "they" correctly refers to "the students," maintaining proper pronoun-antecedent agreement.
The other sentences have issues with pronoun-antecedent agreement:
- "When David and Eduardo came over, he wanted to know if we could go swimming." (Here "he" does not agree with the plural antecedents, David and Eduardo.)
- "Fatima and Shawna went to the store, but she could not find what she was looking for." (Here "she" does not agree with the plural antecedents, Fatima and Shawna.)
- "Once the movies at the theater started, it brought smiles to many faces!" (While this sentence is not incorrect, "it" could be misleading as "movies" is plural, making the context less clear.)