This is a very complex area, "stress" is a feature of syllabic pronounce at the lexical level, a feature of English information structure at the pragmatic level, and a feature of intonation at the sentence level. I know a little about it, but have not studied it formally. The feature itself can have components of loudness, rhythm, vowel quality, and pitch that vary in complex ways.
I read a book on the American accent which says that the primary
stress is usually on the last content word in sentences. I think, in
phonetics that is called the nuclear stress or final inflection. In
the case above, that word is MILK.
I don't know about the terms "nuclear stress" or "final inflection"; however, I would say that this pattern is true of the default declarative intonation in American English if no informational stress pattern is present. It is part of what some people describe as the comparatively flat intonation characteristic of most American English accents. I would also say that to my ear, the components involve pitch more than relative prominence.
Even though you might call this a default intonation pattern, it is routinely overridden by stress rhythms imposed by the information structure which is expressed in English with its own stress patterns. If there is clearly a word that is more informative than others, it will receive more stress. Words that represent given, predictable, or assumed information are normally de-stressed.
Typically, such informative words come later in the sentence, because English speakers tend to place more informative and specific words later in the sentence, when there is a choice; however, such placement is by no means a requirement and stress is not directly driven by word placement. I could give such stress to any word in any of the sentences you have listed in your question without changing the order, except the second instance of "to" used to indicate an infinitive, which cannot contrast with any other word in such a position. You can also give such stress to multiple words in a sentence, but will often put them in a stress hierarchy to give more fine grained focus.
I read a book on the American accent which says that the primary
stress is usually on the last content word in sentences. I think, in
phonetics that is called the nuclear stress or final inflection. In
the case above, that word is MILK.
I WENT to the STORE to BUY ↘︎MILK.
This is only one of many stress patterns that could be used for this sentence, and the pitch of "milk" would by no higher than the pitch of "Buy." If the speaker wanted to indicate that what was important about the utterance was "milk," the pitch of "milk" would be higher than the pitch of "BUY" and perhaps louder. All the rest would be "de-stressed," since it would be detail or what one would expect to take place when obtaining milk from outside the house is at issue.
Such a stress pattern focusing on "milk" might be expected if the full context was: "Since there was nothing to drink in the refrigerator, I went to the store to buy milk." In such a case, the fact of a shopping trip may not be surprising or particularly informative, but the choice of drink might be. It's almost as if you said: "Nothing in the fridge, so milk!" The rest is guessable detail. You could replace "buy" with "get" or "bring back" with the same pragmatic meaning; however, if you used the word "steal," this would be highly surprising and informative and would require that you stress that word in addition to the stress on "milk." You could also not stress "milk" and use the default intonation to indicate pragmatically that you took action because of the empty fridge, all else being unimportant detail.
If, on the other hand, milk were already a topic of the conversation, the word "milk" would not receive stress. Imagine that the conversation is taking place where milk is normally delivered to a home, as used to be the case in the US. The full context could be: "Since the milkman had not yet arrived, I went to the store to buy milk." In this case, the fact that milk is what is bought is no longer informative and so the word "milk" would not receive stress. Instead, you might stress the word "store," since the source of the milk might be what is informative. The word "went" would not be stressed, since a trip to the store is what is expected when a store is invoked at all.
Now imagine that the full context was: "I was sitting in the park and feeling really thirsty, so I went to the store to buy milk." Here, you would probably stress both the words "store" and "milk." Both the source of a solution to your predicament and the particular type of drink are informative, so you would probably stress both "store" and "milk."
Now consider the sentence: "I went to buy milk at the store." You could stress either "milk" or "store" or both, depending on what implicit question your statement answers. If you stress the word "milk," the sentence would sound slightly awkward, since so many unstressed words would follow and so would commonly, but not obligatorily, be rearranged as "I went to the store to buy milk." Similarly, if you were to stress the word "store" in this last sentence, it would be better, but not obligatory, to use the first version where the main stress would be at the end. This preference for stressing words toward the end of the sentence is probably what lies behind your source stating that "the primary stress is usually on the last content word in sentences." This is usually the case, but it is not necessarily so.
Lastly, consider the sentence: "I went to buy milk at the store yesterday." Typically, "yesterday" would not be stressed, even though it is the last content word in the sentence. This lack of stress is because the date of the purchasing event is usually not important to the purpose of the communication; however, the date would be important if the timing of the event was especially noteworthy. More normally in such cases, "yesterday" would be placed at the beginning of the sentence to set the scene; but such movement is subject to other nuances of information structure and again is not obligatory. What you stress and what order you use impacts what point you want to make and what thought you want to leave as a potential topic for future discussion.
It MUST be the ↘︎STORM.
MUST = Secondary stress
STORM = Primary stress
Most typically, only "storm" would be stressed; however, you could also give some stress to "must" if you want to express hesitation about your conclusion and implicitly contrast that word with other words that could be used, such as "must not" or "could." With no stress on "must," it is pragmatically the same as saying: "Aaah, the storm." The relevance of your comment is expected to be clear from the context.
WHAT ↘︎HAPpened?
WHAT = Secondary stress
HAP = Primary stress
This is the typical pattern, because "happened" is much richer in information than an interrogatory pronoun; however, if the fact of something happening has already been stated, then it would be normal to remove the expected stress from "happened" as old, assumed information and put stress only on "what." In any case, it is somewhat difficult to separate the stress pattern from the intonational prosody, given that there are many ways to say these words with different nuances. It is even possible to remove all stress from "what," if you are less interested in hearing a detailed description of what occurred than wanting to express your dismay or surprise at the mere occurrence of the event. The fact of your dismay or surprise makes it obvious that there must be a cause that acts as a "what."
I guess after the nuclear stress there cannot be stressed words
anymore, if I shift stress and stress the pronoun now:
↘︎I went to the store to buy milk.
then everything falls down after the pronoun. Right?
I don't think this is a rule of prosody, but just something that frequently happens because of other word-order rules. In this sentence, such a stress pattern would be normal if somebody going to the store to buy milk was already given, assumed, or expected information in the conversation. The rules would then remove stress from everything fitting that description. If, on the other hand, some of the details were not given and were noteworthy, they could still receive stress.
For example, imagine the fuller context was: "My spouse went to the neighbors to ask for some milk, but they didn't have any. So I had to go to the store to buy milk." In this case, you could put stress on both "I" and "store" to contrast with the equivalent words used in the previous sentence. Instead of stressing "store" to contrast with "neighbors," you could also stress "buy" to contrast with "ask for," but this would change what exactly you were communicating and imply that "asking for" the milk was somehow problematic as a solution.
Please note that the appropriate stress patterns are obligatory in speech, but admit to varying possibilities, depending on the context and the purpose of your communication. Such nuances of speech are not always easily represented in writing. As a result, formal writing usually avoids sentences that have tricky stress patterns that are not easily predicted in context. Even native speakers may have to reread such sentences to figure out what stress pattern is presumed and appropriate in order to yield a meaning that is pragmatically acceptable.