You have to work for 5 years straight in order to get your unemployement benefits if you decide to leave by yourself. It does NOT have to be for the same employer.
Note that you won't have any money if you leave without professional project (create a company, reconversion..). You won't be paid to stay at home.
If you leave your new job before 3 month, you can have access to unemployement benefits ONLY if your last contract got terminated OR if you and your last employer mutualy agreed on a "rupture conventionnelle" without requesting unemployement benefits after this occasion.
Because "rupture conventionnelle" open unemployement benefits.
In your case, you are considered privilegied because you're not struggling to find a job, you even think about leaving it "just, because" while some other people endup without anything for a long time after a 6 months fixed term contract. This is not your case.
Also, France Employement Service (Pole Emploi) will propose you job offer related to your field if you're not actively looking for a job, you won't be able to decline their offer or they will suspend your unemployement benefits.
The best way to get your unemployement benefits is to ask for a "rupture conventionnelle" but employer don't like it that much, especially if it doesn't got their way.
If you really want to have unemployement benefits, you still can do an "abandon de poste" which is very common in McDonald for example. You just don't show up until your contract got terminated for "faute grave" (serious mistake) but it can take a long time AND YOU REALLY SHOULD NOT DO THAT.
I also want to add something,
You said that they ask you to work for company C at company B before becoming a company B employee, this sound illegal. It's called "délit de marchandage" or "prêt de main œuvre illégale".
Well if company B pay company C for someone instead of a service, there is problem. If company B need someone, they should be hiring that person.
French Laws are clear on this point. A service is not a person and a person is not a service. If company B request someone to company C and you're exactly working like a company B employee (as a C employee your directly report to a B manager for example), this is 100% illegal even if it's really common in France (mainly for IT jobs).
In this case, if you have something explaining this on a mail or paper, you can press charge against companies B and C and get compensation for abusing you and the market. You can also request company B to hire you but nobody like to be hired that way.