Remote workers in Europe / France - contract

Hi!
I’m new here and considering getting a remote job. Do you have any experience with how work contracts work when you start working with a company outside your living country.
I live in France, and I’m wondering how I can have a contract with a foreign company and benefit from the social security and all the social contributions there are in France.

Thanks for your help :slight_smile: