they will always prefer to wear whatever has a higher armor rating.
To expand on this, they prefer to wear whatever has the higher armor rating
for them. Many followers have different skill levels in different types of armor, so just because a piece of armor has a higher rating for you doesn't mean it will for them. For example, most housecarls will prefer heavy armor because they have a higher skill level in heavy than light, but using fortify gear + potions, you can get them wearing some upgraded Forsworn gear. The key is to get the armor rating high enough for their skill level.
Also, they will utilize enchantments, but don't factor them in when deciding what to equip.