In The One Hundred and Fifty Verses of Praise states:
Take refuge in whomever
Has absolutely no shortcomings,
Absolutely no blindness, and in whom resides
Every aspect of all good qualities.
When you think of this,
Respect those who praise him
And abide by his teachings.
As long as we have the ability to discern who we should and should not take take refuge in, we must then take refuge in the true Dharma, the lineage masters and their teachings, and those who practice and live in accordance to the teachings. Most people in the world are inclined to seek protection from beings like the demon king, beings from the heavenly, dragon and ghost realms etc; other non-Dharma kind of refuge, it is usually the God Brahma and King of Heaven, Indra etc. These ghost and heavenly beings themselves are still cycling in cyclic existence, therefore, refuge should not be taken in them. So who and what are the ultimate objects of refuge?
Seventy Verses on Taking Refuge states that:
Buddha, Dharma, and Sangha are the refuge for those desirous of liberation.
The only objects of refuge are the Three Jewels - the Buddha, Dharma and Sangha.
excerpts from Liberation in the Palm of Your Hand