verb
to make a fool of, kid, wind up, razz (someone); to pull someone's leg, take the piss
“¿Me estás tomando el pelo?” — Are you pulling my leg?
Synonyms: agarrar para la joda, hablar de chanza, hacer mofa, huevear, mamar gallo, estar de coña
Related: tomada de pelo, tomadura de pelo
Literally, “to take the hair”. Maybe derived from the old prank of taking off someone else's wig.