I will answer this with VFL/AFL History in mind............The answer is Jock McHale who coached Collingwood from 1912 to 1949 and unbelievalbe record in anyones language.
Kevin sheedy, essendon 1981 to 2007 (26 years) if only counting AFL years (post name change) then its still him just with it being 1990 to 2007 totalling 17 years