A person is considered to be resident
1- If he is in India for a period of 182 days or more during the previous year; or
2. If he is in India for a period of 60 days or more during the previous year and 365 days or more during 4 years immediately preceding that year.
The period of 60 days as mentioned in (2) above shall be substituted with 120 days, if an Indian citizen or a person of Indian origin whose total income, other than income from foreign sources, exceeds Rs. 15 lakhs during the previous year from FY 2020-21.
If you satisfy these conditions, You are a Resident. Otherwise you will be treated as a Non Resident.
If you are Non Resident, you'll be taxable in India for the income earned or accrued in India and not on total income.
But if you are resident, then you are liable to pay tax on your total income, and you can take advantage of DTAA.
I hope this help.