They have legal entities in quite a few countries, but most of them are in countries that have labour-friendly rules. https://about.gitlab.com/handbook/finance/payroll/#legal-ent...
Everywhere else it must be similar to freelancing. You give them receipts and they pay. But you still have a contract with the company. But if you both are in different countries I am not sure how much practical value does that contract have.