Tax on capital gains in home country

I recently moved to Germany from another EU country. In Germany, I have worked and paid taxes from day 1, and I will continue to do so for as long as I stay. It's hard to predict exactly how long I'll stay - my first work contract is limited to 4 months, but I expect to have it extended and stay up for up to 2 years (impossible to say).

In my home country I'm an active investor - mainly stocks. I will continue with this while staying in Germany, keeping all accounts in my home country.

Question: at what point will I be liable to pay German capital gains tax on the profits that I make in my home country? If I stay 4 months, I can't imagine being forced to pay taxes on capital gains from home, but surely at some point down the line I'll pass a threshold and full tax liability will kick in? Where exactly is this point?

Also happy to hear how others in a similar boat have approached taxes on foreign capital gains. I would ideally avoid it altogether and just be taxed in my home country like now (my home country won't mind, curious if I could get away with it from Germany's perspective).

In Germany, you are tax-liable on your entire world income from the day you take residence here - UNLESS a bilateral tax treaty with your home country specifies otherwise. So you should check that treaty (as far as I know, Germany has them with all EU countries).
In any case, you must disclose your entire world income (whether taxable or not) in your yearly German tax declaration. This has two reasons: For one, it is up to them (not you) to decide what is taxable and what not. On the other hand, even non-taxable income can change the tax rate applied to your taxable pay.
Get a professional tax adviser (who has experience with such international matters). Their fee is well spent, as a non-native speaker cannot manage these complex issues alone (and a wrong declaration is a criminal offense!).