What determines how a company is tax resident

When determining where a foreign company is resident, it is not sufficient to examine how it was formed (recorded).