You are trying to connect with 2 different versions of the game.
Minecraft - Windows 10 Edition, the game you're playing, is part of the universal Minecraft game, written in C++, compatible with phones, tablets, game consoles, and Windows 10 PCs.
Minecraft - Java Edition is the other edition of Minecraft. This is most likely the one your friend is playing on his Mac, and more likely the one his server is compatible with.
Minecraft Java Edition and Windows 10 Edition are NOT compatible with each other. In order to play on your friend's server, you will have to download the java edition of the game here.
If you don't own a copy of that version you may have to buy it.
Good luck and have fun!
Short answer: you can't.
The new better together update allows cross-platform play, but only between the Xbox One S, Xbox One X, Android, iPhone, iPad, Apple TV, Windows 10, Windows Phone, Amazon Fire tablets, Gear VR and eventually the Nintendo Switch edition.
NOTE: When it says Windows 10 it means the Windows 10 Edition, which is different from the Java version for PC/Mac.
As Augustas said, you can't play in a friends world if he is not active. However, if you or a friend purchases a realms subscription, it will be perpetually available so long as you keep paying the fee.
($3.99/mo. for up to 3 simultaneous players, up to $7.99/mo. for up to 11 simultaneous players). Only one person needs to pay this fee - all friends play free. If you want something akin to a Java edition server, this is as close as you can get.
Also, just since you didn't mention it in your question, you do need an Xbox Live Gold membership to be able to access Realms on Xbox One, though it is not needed for other versions.
Best Answer
You either have to download and use an old version of Minecraft, or petition the server admin to update their version.