You need to build up more than one line in either the pattern space or the hold space. Then have commands that use `\n' for the newline. The $ metacharacter will match the end of the buffer and not an embedded newline.
Use the N command to append to the pattern space, and H to append to the hold space.
Code:
cat testfile.txt
Hello World.
Hello
World.
Hello cruel world.
Code:
sed '/Hello/{ s/Hello World/Just Hello/;t
N;/Hello\nWorld/{N;s//Just\nHello/}
}' testfile.txt
Just Hello.
Just
Hello.
Hello cruel world.