How the ranking is made
Only the degree inside the sign counts, not the absolute longitude. A graha at 28° of Gemini outranks one at 3° of Capricorn, even though the second sits further along the zodiac. Sort all the participating grahas from highest degree to lowest and assign the karakas in order.
Highest degree in sign → Atmakaraka · Lowest → Darakaraka
Seven karakas or eight
Two schemes are in use and they give different answers. The seven-graha scheme ranks Sun through Saturn only. The eight-graha scheme adds Rahu, which inserts PitriKaraka — the father significator — at rank seven and pushes Darakaraka down to eight. Ketu never takes part in either.
Adding Rahu can change more than the tail of the list. Because Rahu is counted in reverse, it often lands near the top, displacing every karaka below it by one rank.
Why Rahu counts backwards
Rahu moves retrograde through the zodiac, so its degree is taken from the far end of the sign: 30 degrees minus its position. A Rahu at 2°50' therefore ranks as 27°10' and sits near the top of the list, not the bottom. Miss this and every chart with Rahu included comes out wrong from rank two down.
Why the birth time has to be right
Karakas are decided by degrees, and degrees move. The Moon covers about thirteen degrees a day, so a birth time out by an hour shifts it by half a degree — enough to swap two karakas when they sit close together. This page flags any pair within one degree of each other, so you can see when your result is finely balanced rather than assuming it is settled.