can I get custody of my granddaughter who my husband and I had for 5 and a half years
Not enough information to make an answer. See a loal attorney with all information.
Potentially yes. Contact a lawyer.