The homework question said "which 2nd row element has 6 valence electrons and a valence of 2?"

I don't really understand the question, because oxygen would be the element with the 6 valence electrons, but wouldn't that mean that it has a valence of 6? Does the "valence of 2" mean that it can make 2 bonds to fill its octet?

Yes.

Yes, you are correct. The valence refers to the number of electrons an atom needs to gain or lose in order to achieve a full octet (a total of 8 valence electrons). Oxygen has 6 valence electrons, so it needs to gain 2 electrons to fill its octet.

In the context of the question, when it says "valence of 2," it means that the element can form 2 bonds to fill its octet. This means that the element has an oxidation state of +2 when it forms compounds.

Yes, you are correct in your understanding. The term "valence" generally refers to the number of bonds an element can form to achieve a stable electron configuration or fulfill its octet rule. Oxygen indeed has 6 valence electrons, but it can only form 2 bonds to fill its octet. Therefore, its valence is 2 in this context.