Simple… YOU BOTH PURCHASED DIFFERENT VERSIONS!
The Minecraft & Mojang websites are selling the Java Edition… Or the ORIGINAL VERSION of the game. It can only connect to other players running that edition on PC (Windows, Mac, Linux, ect.)
The Microsoft Store sells the now standard edition of Minecraft (formerly known as the "Windows 10 Edition"), which runs on the Bedrock Engine & has cross-platform support with XBox One, Switch & Mobile (iOS / Android).
The Java & Bedrock Editions are not compatible with each other, hence why you're not being able to connect with your friends & why the version numbers aren't matching up. You will either have to purchase the Java Edition OR your friends will need to purchase the Bedrock Edition to everybody together.
I know this isn't the answer you wanted to hear (as somebody will have to buy the proper version of the game), but this will explain why you're having problems.