Pregnancy tests detect the presence of the hormone human chorionic gonadotropin (hCG), hCG is a hormone which is secreted by the placenta shortly after fertilization and within 2-3 days after implantation. The placenta starts developing at the time of implantation of the fertilized egg in a woman's uterus, which happens on average about a week after ovulation and fertilization with a range of 6-12 days. Early pregnancy tests can never diagnose the presence of the hCG hormone until after implantation has taken place, and the earliest these tests can be used to detect pregnancy in the blood is about 8-9 days after fertilization/ovulation, and 2-3 days later in the woman's urine.
Early pregnancy tests work by binding the hCG hormone, from either blood or urine, to an antibody and an indicator. The antibody will only bind to hCG; other hormones will not give a positive test result. The usual indicator is a pigment molecule, present in a line across a home pregnancy urine test. The tests in the doctor's office and those available over-the-counter are about the same. Blood tests are pretty much equally sensitive at any time. Urine tests tend to be most sensitive using urine from early morning, which tends to be more concentrated (would have the highest levels of hCG).
False Positive and Negative Pregnancy Tests
Most medications, including birth control pills and antibiotics, do not affect the results of pregnancy tests. Alcohol and illegal drugs do not affect the test results. The only drugs that can cause a false positive are those containing the pregnancy hormone hCG in them (usually used for treating infertility).
Some tissues in a non-pregnant woman can produce hCG, but the levels are normally too low to be within the detectable range of the tests.
For some urine pregnancy tests, evaporation may form a line that could be interpreted as a false 'positive', which is a positive test without being pregnant. This is why tests have a time limit during which you should examine the results. It's untrue that urine from a man will give a positive test result.