Complex sentence: Whereas sex refers to someone's anatomy, gender refers either to gender identity or gender role, the roles and qualities that society associates with being either male or female.
Split into simpler sentences: Whereas sex refers to someone's anatomy, gender is more about someone's sexual identification or orientation. Gender refers to the roles and qualities that society associates with being either male or female.