Some possibilities:
a. He likes the sensation; a way of hiding and altering sensory input (my NT daughter pulls her pillow over head when she is upset; it helps her feel buffered from the world).
b. He is seriously considering ending his life (my NT daughter is also my child who experiences depression and has talked not seeing the point in living, but for her I do NOT think the pillow thing is any sort of trial run or experiment).
A is OK but risky. B requires serious counseling. I don't think its an AS thing, although there definitely could be a sensory component. It is, after all, my NT daughter who came to my mind when I read your post, and not my AS son. He needs to talk with a counselor that he feels safe with.
Also, keep your eye out for sudden and unexpected POSITIVE changes in his mood. People who have been suicidal often get happier and calmer once they've made an affirmative decision on how and when they plan to end their lives. It is an important thing to know, when living with someone who experiences depression and has expressed any sort of suicidal thoughts.
_________________
Mom to an amazing young adult AS son, plus an also amazing non-AS daughter. Most likely part of the "Broader Autism Phenotype" (some traits).