There is a short window in time that you can actually test HIV negative and still be HIV infected. How you ask? When HIV initially infects the body, your immune system begins to develop antibodies to the virus. It's those antibodies that HIV tests detect when you get HIV tested. It takes some time for enough of those antibodies to be produced for an HIV test to detect them. Therefore too little HIV antibody has not been produced when you get tested, the test result will be negative when in fact you are HIV infected.
It's for this reason that experts suggest a series of HIV tests; a test soon after exposure (for a baseline); a test 6 weeks after exposure; and finally a test 3 months after exposure. In fact, some people now suggest another HIV test 6 months after exposure. After the series of tests if you are HIV negative and have had no new exposures, consider yourself HIV negative.
If you have another exposure during your series of tests, the series of tests needs to start over from the point of the new exposure.