Police say the man confessed to killing his wife and kids