Soak beans overnight in a large bowl with water to cover by 2 in.
Drain beans and transfer to a 5- to 6-qt. pot. Add 3 cups water, the coconut milk, garlic, and green onions. Cover pot and bring to a boil; then reduce heat and simmer until beans are tender but not mushy, 50 to 60 minutes.
Measure mixture and add water if needed to make 7 cups; return to pot.
Stir in allspice, thyme, 2 tsp. salt, and the rice. Return to a boil, then reduce heat and simmer, covered, until rice is tender and has absorbed almost all of liquid, 15 to 20 minutes. Stir, remove from heat, and let stand, covered, 5 minutes. Season to taste with more salt and discard green onions if you like.