The BBC breached broadcasting rules with a Gaza documentary narrated by a boy with links to Hamas, Ofcom has found.