The certificate is Form 6166
A US tax residency certificate is not something you write. It is issued by the IRS, on Form 6166, in response to an application on Form 8802.
It certifies residency for a specified year, so the year you request has to match the income you are claiming relief on.
Where it fits in the chain
Three steps, in order, and each depends on the one before it. Apply on Form 8802. Receive Form 6166 from the IRS. File the Indian information form, now Form 41, and give both documents to the Indian payer.
Nobody publishes these three steps together, which is why people usually discover step three after the withholding has already happened.
What India does with it
The Indian side needs the certificate plus an information form giving your status, tax number, address abroad and the period the certificate covers.
That form must be filed online. If you do not hold an Indian PAN and are not required to, you register under a separate non-resident category and verify by one-time password. No Indian digital signature is needed.
What to do next
This page explains a rule. It does not work out what you owe, and it is not US tax advice. Take your fund statements to a US CPA or an Enrolled Agent, because the analysis runs per fund, per year.