A teenager claims he was acting in self-defence when he fatally stabbed his housemate, a murder trial was told.