The trick is to learn words rather than kanji in isolation – you wouldn’t teach someone English by saying “C is pronounced K some of the time and S other times” and then just leave it at that. Once you get a fair bit of vocab under your belt, you start to get a pretty good feel for which readings should be used in any new words you encounter. 七 is a bit of a weird one, anyway – its readings are fairly interchangeable.
The issue with “kanji use on’yomi when they’re in words and kun’yomi when they’re alone” is that there’s a ridiculous number of exceptions. Of course, the “every rule has exceptions” rule also has an exception: kanji with attached okurigana (hiragana tacked onto the end of adjectives and verbs to indicate conjugation and whatnot) always use the kun’yomi.