Sex is the biological traits that determine Male or Female, of which there are truly only 2.
Gender are the roles in society that the 2 sexes are expected to fill, traditionally the roles of gender Gender were separate and tied only to your Sex, thanks to Gender Identities being accepted we can fill a different gender role than what would be expected of our Sex. While not the same as biological sex, Gender is defined as characteristics in a social construct, not behavior.
Gender Identity, while similar to Gender, is not the same. Gender Identity is what one feels about themselves and how they identify themselves, whether they feel like a man, woman, neither, both, or something else.
And for bonus, Sexuality is a classification system for Gender Identities.