How to upload a 360 video to facebook or youtube

I have seen 360 videos on Facebook where the viewer can spin the video around but I'll be darned if I can find an explanation of how to export a video and get it on there in a 360 format. I can export an mp4 that I have created Tiny Planet effects but it is not something the viewer on Facebook can move around. Insta360 studio always seems to export flat mp4 so I'm thinking it can only be done from my iPhone. Is that correct? Can anyone point me to a tutorial on how to 1) export a 360 that will end up being viewable as a 360video and 2) Import it to facebook. I think if the file has the proper meta data Facebook will see it and treat it as such.