Why can I play Minecraft online with my friends even though we both don't have Xbox gold?
Solution 1:
Currently, there is an All Access Event going on right now for Minecraft on Xbox. From May 19th-21st 2017, all players can play Minecraft online regardless of their subscription.
We’re launching a Multiplayer All-Access event with a free unlock of Minecraft: Xbox One Edition. Xbox is inviting all Xbox Live members, with or without a Gold membership, to play online with friends for free in any game they own during our Multiplayer All-Access event from May 18-21 on Xbox One and Xbox 360.
However, after this event you will still need gold. See Does Minecraft for Xbox require a gold account to play with other players?