Some of the main reasons your friend can’t connect to your Minecraft server are include:
Playing different versions/types of Minecraft. Everyone needs to be on the same type. It could be either Java or Bedrock.
Cracked Minecraft can’t connect to most servers.
Incompatible mods.
They aren’t whitelisted