When is a girl touching a guy friendly and when is it flirting? What factors are there? Is it the body part being touched? Duration?

I have a hard time finding the diff

When is a girl touching a guy friendly and when is it flirting? What factors are there? Is it the body part being touched? Duration?
Post Opinion