Capital gains on index funds bought before moving to Japan.

I have some vanguard index funds I invested in before moving to Japan. I’ve been here for four years now on a spouse visa. Will I owe Japanese taxes on the capital gains if I sell them now? I’ve tried to research this but keep finding conflicting information (especially with regard to what counts as a permanent tax resident).

It sounds like the answer is that I will not owe Japanese taxes, I will only owe US taxes, and moreover I should probably realise the gains now before becoming a permanent tax resident, but just curious if someone else who as been through this might have something to add.

by MutedForComparison