Play Minecraft together on two devices?

Ch
- in Worlds
1

I would like to play Minecraft together with my girlfriend on two different devices on one world. You can add friends there, but it says "Due to the settings of your Microsoft account, you can't add friends. Please make sure that your online security settings allow adding friends. You can find these settings under" (then the link ) but these steps don't work for me. I wanted to ask if anyone has had experience with it and can help me.

te

Doesn't it just need the IP?