Hi,
You will have to establish your residence position in the first instance. Please see RDR3 Statutory Residence Test which will help you do this.
RDR3 Statutory Residence Test
Please also see Tax on foreign income: Overview.
Tax on foreign income
If you are regarded as UK resident then you are required to declare your worldwide income to the UK. If not UK resident then your income should be declared to your country of residence.
With regard to your national insurance enquiry, please contact the National Insurance team.
National Insurance: non-UK residents
Thank you.