'Both' and 'sold' are exceptions to the "rule". There are a couple of ways a vowel can make the long vowel sound The first way that a vowel can make the long vowel sound is that there should be another vowel after the first vowel. In school we would recite this rule by saying, "the first one talks and the second one walks." The second way is that there is a silent e at the end of the word. Here is an example of two words that sound the same but follow each of the different long vowel sounds; soul and sole are both pronounced with the long 'o' sound.
Therefore 'loft' and 'soft' are following the rules, and 'solid' is bending the rules a bit. But 'both' and 'sold' are breaking the rules.
English is just a difficult language.