When your parents live together, they are both responsible for taking care of you. When your parents stop living together, they are usually both still responsible for you, but daily decisions might be made by the parent you live with most of the time..
Your parents might be able to agree on custody and visiting rights themselves. But if they can't agree, even with the help of a mediator, they'll have to go to court and have a judge decide.
If this happens, the judge who is making the decisions will consider things like these:
If one parent has sole custody and you live only with that parent, the other parent usually has visiting rights, which means that you can visit that parent. There are lots of different ways to arrange how you spend time with the parent who has visiting rights. Visits might be for a few hours every week, or for weekends or a few days every two weeks or month. If the parent with visiting rights lives far away, visits might include keeping in touch in other ways, like phone calls, e-mails or letters.
Visiting rights might be very specific — actually spelling out the specific hours and days for visits — or very general and flexible.