Females normally have XX chromosomes and female primary and secondary sex characteristics.
Males normally have XY chromosomes and male primary and secondary sex characteristics.
This isn't always the case, though. There are intersexed people, because although we'd like to think of sex/gender as binary, it's not.
For some examples:
Androgen Insensitivity Syndrome:
The person has XY (male) chromosomes, but the cells are completely insensitive to androgens (male hormones). The result is that the person is born and appears to be female in terms of what's between her legs, usually develops a female gender identity, and grows up to look like a woman. Actually, they more often look like models than genetic females, because they're often tall and thin, have less hair than a genetic female (because even females have some testosterone and these people can't process it at all), and they develop female secondary sex characteristics of a woman (like breasts). In other words, they often appear even more feminine than genetic females. It's often impossible to know that the female child even has this condition until later in life unless they do a genetic test; she could grow up entirely as a woman and then be told later in life that actually she has XY chromosomes. The person can't give birth. The tend to have female gender identities due to lack of male hormonal effects on the brain and social conditioning, and are in most ways indistinguishable from genetic females.
Klinefelter Syndrome
The person has XXY chromosomes (compared to women that have XX and men that have XY). The person often appears to be a male, but has less testosterone and therefore develops fewer secondary sex characteristics of males. They tend to grow breasts and have some female secondary sex characteristics. So in terms of appearance, they're a mix between males and females. Treatment sometimes includes giving them testosterone to push their bodies more towards the male side. Often infertile.
Other Conditions
There are a vast number of conditions that can lead to a person being intersexed. There are a huge number of conditions where people with XY chromosomes are mostly like females, and some conditions where people with XX chromosomes are more like males. There are a variety of XXY, XO, XXXY, XYY, XXX chromosome possibilities that exist. There are individuals that have ambiguous genitalia. There are individuals with various hormonal influences. There are individuals with various gender identities (with the primary factor being hormonal influences in the womb). There are individuals with a variety of secondary sex characteristics.
.....
The prevalence of these individuals is hard to measure and depends partially on the definition since it's an umbrella of countless different medical conditions, but it's something like one in several hundred births. Millions of people worldwide.
The question to Christians and Muslims that believe homosexuality is a sin:
To what gender/sex should these individuals form sexual partnerships with to avoid the wrath, violence, or torture from Jesus and his father, or Allah?