If you're on treatment and have immeasurable virus levels, you cannot transmit HIV when having sex, even if a condom is not used. The safest thing you can do, if you want to avoid getting HIV yourself, is to have sex with somebody how have undetectable HIV.
Undetectable HIV cannot be transmitted when having sex, even if a condom is not used. However, using a condom is still important as it protects against transmission of STIs such as chlamydia, gonorrhea and syphilis. If you are uncertain about your own or your partners’ HIV status, the condom is also an effective protection against the transmission of HIV.
Read more about O = O, or U = U (undetectable = untransmittable), here (opens in new tab)
Read more about the Partner II study here (opens in new tab)