Shaving the head (mencukur habis) is more virtuous than trimming (memotong rambut) for men after both Haji and Umrah. Nabi (shallallahu alaihi wa sallam) made doa 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 Nabi's triple doa. He sunnah that men shave their heads after Haji and after Umrah. However, if a man is performing Haji tamattu' (Umrah followed by Haji), it is better for him to trim after the Umrah and save the shaving for after the Haji 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 Nabi himself shaved his head during the Farewell Haji. He distributed his hair among the companions, who treasured it. For women, shaving the head is not boleh — they only trim a fingertip's length from the ends of their hair. This applies to women after both Haji and Umrah without exception.