Always choose the neighbour whose southernmost point on land is furthest south, when left with no neighbours go back to the previous country and follow with the neighbour that is second southernmost.
Start with the southernmost point on land.
Overseas borders are considered: UK-Spain, Spain-Morocco, France-Netherlands, France-Brazil/Suriname, Malaysia-Singapore
Dubious borders: India-Sri Lanka, and Denmark-Sweden border are considered, Qatar-UAE isn't
I spotted a few moments that seemed to be mistakes though:
-Burundi is skipped: I think it should come right after Rwanda, instead of going from Rwanda to Uganda
-After Armenia comes Georgia, but it should be Turkey instead
Burundi Should be between the DRC and Rwanda