Where you work decides the tax
It is natural to think that a foreign salary, paid by a foreign company into a foreign account, has nothing to do with Indian tax. But the Indian rule looks at where the work is done, not where the money comes from. Under Section 9(1)(ii), salary for services rendered in India is treated as income earned in India, and the law is explicit that this holds regardless of where the employer is or where the salary is paid. So when you sit in India and work, even remotely, even for a company with no Indian presence, the salary for those India-worked days is Indian-source and taxable here.
This is the trap in the modern workation: people assume that keeping the job, the employer and the bank account abroad keeps the tax abroad too. It does not. The physical fact of working from India is what brings that portion of your salary into the Indian net. And it stacks with a second risk. If your stay is long enough that you become resident, discussed on our day-counting page, the exposure is no longer limited to the India-worked salary, your entire global income can become taxable in India.
The treaty relief, and the employer's risk
A tax treaty can rescue you, but only within tight limits. The employment article, usually Article 15, called dependent personal services and numbered Article 16 in some of India's older treaties, gives a short-stay exemption: India cannot tax your foreign employment income if three conditions are all met. You are present in India for 183 days or fewer, your employer is not a resident of India, and your salary cost is not borne by a permanent establishment your employer has in India. All three have to hold together, so if any one fails, for example your stay tips over 183 days, the exemption goes and India can tax the India-worked salary. The day count and the exact window are treaty-specific, so the precise test depends on your country.
There is a further consequence you should know about, even though it is your employer's problem more than yours: an employee habitually working from India can create a permanent establishment, or a place-of-effective-management issue, for the foreign company, which can drag the employer into Indian tax. That is covered on our separate page on running a foreign company from India. A practising CA works out how much of your salary is taxable in India, whether the treaty exemption is available, and how to keep both your residency and your employer's exposure in check.