Yes, condoms work! As long as the condom did not burst WIDE open - which you would have noticed - you were completely protected from HIV.
There are condoms that aren't recommended to prevent HIV, though they do work to prevent pregnancy, I believe, but I also believe they are the very thin lambskin ones. Don't see them much anymore. Don't know anything about the one you used.