Babies don't learn automatically to self-soothe until quite a bit older. They will "settle" sometimes if they become too discouraged or frustrated at not getting their needs met. In a baby under maybe a year old, that's rather sad, a sign of discouragement.
But you can help a child learn to entertain herself or self-soothe by giving her tools and transitional "rituals" that she can gradually learn to fall back on. As she gets older, the time periods she'll be able to do this will become longer and longer, especially as she learns to handle objects, roll over, motor around, and use language.
I'm guessing at 5 months she's probably not reliably able to even grab something attractive yet, so she's completely dependent on you to help her move around and interact with the world. No adult = really bored, really fast.
I began helping my daughter and my grandson to accept brief separations at first by making it into a game. I'd say "I'll be right back," and disappear behind a pillow or doorway for just a couple of seconds, then reappear with a funny noise. Fascinating! Rinse and repeat, with a new noise. Begin extending the absences. You can gradually build this up to long enough to go take a pee, or check on the soup.
It's also okay to allow a bit of fussing, as long as it doesn't become desperate, at which point the baby may experience your absence as a breach of trust. Babies really do need their parents for everything, physical and social, until they gain some ability to do things for themselves. But gradually learning to deal with a bit of boredom is reasonable, especially after the child is older than a year.
You might consider wearing her, so she can be up high, participating in all the interesting stuff you're doing. You can talk to her, too, explaining things in simple terms. This is amazingly good for language development, which will be the single best predictor of her eventual success in school.