An ability of a permanent that triggers when a card is put into a graveyard "from anywhere" triggers twice only if Gandalf the White and that permanent are both still on the battlefield immediately after the legendary permanent or the artifact has been put into the graveyard from the battlefield. For example, say you control both Gandalf the White and Soulcipher Board. If another legendary creature you control dies, Soulcipher Board's last ability will trigger twice. But if Gandalf the White dies, Soulcipher Board's last ability will trigger only once.