Ok so this is kinda embarrassing

My friends were talking about losing your virginity and they said that if anything goes up there then you’ve lost your virginity but I thought it was just when it was with another person. So is penetration in masturbation losing your virginity?? My friends really confused me