Quaery on Tax residency 2019-20

Hi, I need some details on what will be my residency status for tax for the current FY 2019-20. I have gone through several Indian tax related sites to have an idea on this but got confused after reading. Below are few information : i) Moved to USA in Mar-2017 month for employment on H1B visa. ii) Planning to return to India either during a) Aug 2019 or b) Oct 2019 My queries are 1) If I return to India during Aug’19 month , I will stay more than 182 day in India for the FY 2019-20. Do I have to pay tax on foreign income? If Yes, Since US FY starts from Jan month, how to calculate foreign tax credit for India tax purpose ( i.e, all taxes that got deducted from Jan month or shall calculate from Apr month). 2) If I return during Oct’19 month , I will stay less than 182 day in India for the FY 2019-20 (but more than 365 days in last 4 years ). So I will be resident Indian for tax purpose Do I have to pay tax on foreign income? Or will I get some exemptions , like for individuals who leave India for employment? Thanks in advance to help me out in resolving my concerns. Regards , Pragya