From Middle English stool, stole, stol, from Old English stōl, from Proto-West Germanic *stōl, from Proto-Germanic *stōlaz (compare West Frisian stoel, Dutch stoel, German Stuhl, Swedish/Norwegian/Danish stol, Finnish tuoli, Estonian tool), from Proto-Indo-European *stoh₂los (compare Lithuanian stálas, Russian стол ("table"), Russian стул ("chair"), Serbo-Croatian stol ("table"), Slovene stol ("chair"), Albanian kështalle ("crutch"), Ancient Greek στήλη ("block of stone used as a prop or buttress to a wall")), from *steh₂-. More at stand.
The medical use derives from sense 2 (seat used for defecation).