How? The HPV virus is transmitted essentially by sexual contact, even without penetration or ejaculation. In theory, HPV can be transmitted via the mucous membranes and also by the cutaneous route (oral sex or touching with the hands), although it appears impossible to prove this with certainty.
When? It is usually impossible to know when the infection was transmitted as the majority of people do not know that they have been exposed.
Who? Likewise, it is usually not possible to know by whom the HPV infection was transmitted as it is a very common infection which can remain “dormant” for years; sex just once is sufficient to be exposed to the virus.