You appear to be referencing the U.N.'s Optional Protocol on the Involvement of Children in Armed Conflict. The U.S. didn't ratify this Protocol until Dec. 2002 and didn't come into force until Jan. 23 2003. Omar Khadr was captured by U.S. forces in July 2002 and presumably was treated according to the legal regime applicable at the time of his capture. 

Article 10 - Instrument of Ratification

44. The United States deposited its instrument of ratification of the Protocol on December 23, 2002. The Protocol entered into force with respect to the United States on January 23, 2003.

https://www.state.gov/j/drl/rls/83929.htm