There is no international agreement or international commitment to leave made (it is a self-imposed deadline by the US). Nobody gets in a room and says, "you, the US, you will sign a document to leave on such and such date to our 'international body "
Btw, we are not leaving as in ZERO presence. The combat troops will leave, but security and Quick reaction forces will still be there
...and we went there because we were attacked, which sometimes does not matter to many here, but those are the facts