During conception the gender of your baby is determined by chromosomes. It is the man's sperm that affects whether you will have a boy or girl.
Unfertilised eggs carry the X chromosome and the sperm can carry either the X chromosome or the Y chromosome.
If an X Chromosome carrying sperm fertilises the egg the baby will be a girl
If a Y chromosome fertilises the egg the baby will be a boy.
Studies show that the X chromosome (the girl one) carrying sperm have a longer life expectancy than the Y chromosome (the boy one), but the Y chromosome carrying sperm have better motility which means that they swim faster.
There is a down side to being able to swim faster as the Y chromosomes uses more energy. The X chromosome is possibly less speedy but contain more mitochondria which are energy producing elements.
If one sperm swims faster it does mean faster arrival at the destination (in this case being egg) but it also means faster expiry. Is has been said that if a woman knows her own ovulation cycle then gender prediction can offer higher odds. Sperm can reach the fallopian tubes between 20 minutes and 2 hours and remain functional for 4-7 days inside a woman.
If you aim for a little boy - Later and frequent intercourse is suggested approximately one day before ovulation. Men with higher sperm counts are more likely to have boys. The girl chromosome (X chromosome) have a longer life expectancy, but decreased speed therefore intercourse taking place earlier before ovulation offer increased chances of having a girl.
If you aim for a little girl . Earlier intercourse is suggested approximately 4 days before ovulation. Due to the shorter expiry of the boy chromosome sperm it may be likely that these sperm will have expired leaving the slower girl chromosome carrying sperm to fertilize the egg.If the egg is released 5 days after intercourse the X chromosome sperm will be in the Fallopian tube after the Y chromosomes have expired.
There are some great books available that offer more in depth information but this is good start!