Gender is a social construct that is not limited to two, and is usually based on the roles and behaviours that are expected of people based on their sex.
Sex is what you are biologically born as; you can either be born male or female
Gender identity is what someone feels about their gender. If someone is struggling with their gender identity, they may be unsure whether they are male/female/non-binary, etc and gender identity can be expressed in many ways.
Sexual orientation describes someone’s romantic/sexual attraction to one or more genders, or lack thereof. There are many sexual orientations, for example gay, straight and lesbian.