Not always.
HPV can live on areas of skin that are not covered by a condom. Condoms can lower the risk, but they do not give full protection.
The best way to get protected from HPV is by having the vaccine.