Shaving the head (halq) is more virtuous than trimming (taqsir) for men after both Hac and Umre. Hz. Peygamber (sallallahu aleyhi ve sellem) made dua three times for those who shave their heads and only once for those who trim, indicating the superiority of shaving. He said: 'O Allah, forgive those who shave their heads,' and the companions said: 'And those who trim, O Messenger of Allah?' He said: 'O Allah, forgive those who shave their heads.' They repeated the question three times, and on the third occasion he added: 'And those who trim.'
Sheikh Ibn Baz stated that while both shaving and trimming are valid ways to exit the state of ihram, shaving is preferred and carries greater reward based on Hz. Peygamber's triple dua. He sunnet that men shave their heads after Hac and after Umre. However, if a man is performing Hac tamattu' (Umre followed by Hac), it is better for him to trim after the Umre and save the shaving for after the Hac rites on the Day of Sacrifice, so that he has hair to shave during the greater rite.
Sheikh Al-Albani confirmed the superiority of shaving and noted that Hz. Peygamber himself shaved his head during the Farewell Hac. He distributed his hair among the companions, who treasured it. For women, shaving the head is not permissible — they only trim a fingertip's length from the ends of their hair. This applies to women after both Hac and Umre without exception.