when i load up halo 5: guardians i get a message that says i can’t play online and another saying profile sync error how do i fix this i can only play solo campaign!!!

How long has this issue been happening? It might be client-side or it may be a server problem.
Here’s a list of things from another thread that you could try:

  • Close the app, reopen it. - Power cycle the console (hold power button down for 10 sec until Xbox fully powers off). May also help to reset your router/modem. - Delete profile from console and redownload it (google this step for instructions).You could also try a reinstall of Halo 5 but I wouldn’t do that until the possibility of server-side issues is ruled out, or you have superfast internet.