The easiest way to use tea tree oil on your hair is to find a shampoo that contains tea tree, preferably with a matching conditioner.
Look out for a shampoo that contains 5% tea tree oil, as this can help you to choose a product with enough tea tree oil to make a difference to your hair.