I don't necessarily understand what you're getting at here, but you write your own code. Your manager gives you a task and you work with them/other people on your team/other teams to get it done. You're an intern, sure, but in a lot of ways you're a full time employee. I was in every team meeting and contributed ideas when I could, as well as taking on tasks that seemed like I could do them. My manager met with me to track my progress and discuss questions or issues I had, but that was it. In the end, the work I did was done by me and I demoed it for the whole team.
If you mean legal ownership, the answer is none basically. You sign a contract saying the work you do for Facebook is Facebook's. This is pretty standard. Any work done on a company's computer is owned by the company. If you plan on working on your own project, do it on your own computer and your own time.
You will be assigned a project as a summer intern at Facebook. The goal/objective of the project should be specified by your mentor at the beginning of your internship. You will own that project and you can decide the milestones of the project with your mentor. In my case my mentor gave me full control of the project. I will decide when to launch features in each milestones and set up meetings with project managers, data scientists and data engineers.