I am getting an error saying something about an online mode error
Could you write the exact text, or link a screenshot of it please?
In any case, try these general troubleshooting steps:
- Complete a cold reset of your Xbox One by holding down the power button for 10 seconds to clear the game cache. - Reset Alternate MAC Address in system network settings on your Xbox One to clear the network cache and to improve the general responsiveness of Halo 5.