How do I open a second account for Minecraft?
"Accounts" in Bedrock Edition work differently to Java Edition. In Java Edition, it is both your entitlement and your profile. However, in Bedrock Edition, you can simply just switch Xbox Accounts and your game will use a different set of player data. Your entitlement (Google Play/App Store/PlayStation Network/Microsoft/Nintendo account) is seperate to your Xbox Account*.
As for playing together, you just need to redownload on a second device using the same Google Play/App Store/PlayStation Network/Microsoft/Nintendo account and redownload the game and make sure you're logged into two different Xbox Accounts.
*You log into an Xbox Account with a Microsoft Account, but in terms of how entitlements work, they're separate. On Console (Xbox/PlayStation/Switch) platforms, each player needs to own their own copy, so you have to log out of the account completely on your consoles in order to get the game working.
Also entitlement = purchase of game aka. right to download