When Breivik was aged 4, and living in Oslo's Frogner borough, two reports were filed expressing concern about his mental health.[47] A psychologist in one report made a note of the boy's peculiar smile, suggesting it was not anchored in his emotions but was rather a deliberate response to his environment.[48] In another report from Norway's National Centre for Child and Adolescent Psychiatry (SSBU), concerns were raised about how Breivik was treated by his mother: "[s]he 'sexualised' the young Breivik, hit him, and frequently told him that she wished that he were dead."
See also https://www.telegraph.co.uk/news/worldnews/europe/norway/959...
See also his Psychiatric evaluation under https://en.wikipedia.org/wiki/Anders_Behring_Breivik
Whatever he did, I have doubts that he was sane. But the question is, which problem does the death penalty really solve? Deterrence? Most death penalty countries have very high crime rates. Prevent another crime from the same individual? Life without parole has the same effect.
PS: Reading about Breivik, he was probably insane or at least on the border of insanity during his crimes. Judging by his actions in prison, he is at least insane by now. I doubt that he well get released after 21 years served and will get preventive detention. So basically, since he is mentally sick now he can't get released from prison, a place where he likely should not have been held in the first place.