I have missed two periods and have tested for pregnancy and it was negative why?

See your doctor. Missed periods are not always due to pregnancy, but it is important to rule that out with a blood pregnancy test. Other causes of missed periods include extreme stress, extreme physical training, and some medical conditions like thyroid disorders and ovarian cysts. You should see your doctor to determine if you need further evaluation based on any associated symptoms.
Check blood test. If you are very worried check with blood test. Assuming that you are pregnant, the most simple explanation is that the test you have purchased from the drugstore is of a lower-sensitivity. This means that the test is capable of detecting pregnancy only when the level of HCG reaches a certain threshold, and the test is simply not sensitive enough to yield the positive result.