A man was told he will spend the rest of his life in jail for brutally beating two young boys to death with a baseball bat.