Many activities carry little or no risk of passing on HIV. As long as you don't let one person's blood, semen, or pre-cum get inside the other person’s body.
Alone or with a partner, masturbation is safe. Keep semen away from cuts and sores and don't use your partner's semen as a lubricant.
Body rubbing and massage is safe. If you do go on to have anal sex after a massage, clean off any oil as this may damage the rubber of a condom.
There's little risk of HIV transmission by rimming - as long as no blood gets into the mouth or anus. However you can get Hepatitis B, Herpes and other infections this way.
Sex toys someone else has used may have small amounts of blood or semen on them. This could be potentially infectious. Put a condom over a dildo if you are going to share it, or clean it with hot soapy water. Not sharing toys at all is safer.
The risk of passing on HIV is low. Try not to tear or damage the inside of the anus. Keep fingernails trimmed and smooth.
Urine and faeces carry little risk of passing on HIV as long as there's no blood in them. You can get Hepatitis B or other infections this way. Keep urine and faeces well away from the eyes.