coconut on babys hair

i wanna use coconut oil on my daughters hair shes 2 months. but not sure if i should rinse it out or if im allowed to leave it in there. i dont wash her hair alot so i usually put baby oil in there to keep from getting dry. can i do the same with cocnut oil , not rinse it out