The morning after pill DOES work in very much the same way that birth control works. They prevent the sperm from reaching the egg and prevent the fertilized egg from attaching to the wall of the uterus. If you took it within 72 hours of having sex you should be okay.
The bigger issue now is that you didn't learn anything after the 1st scare. You had sex with a condom that you thought questionable and had to take the morning after pill again. This pill isn't designed to be used as birth control. It's really aimed at emergency situations. Originally, it was for use after rape. Please go to your local health clinic and get on birth control or you will be back here in 9 months with a whole new set of questions...Tell your bf that you will not have sex with him again until that happens.