Is this your first dog? Do you have children? Training puppies and children is very similar, haha! Use positive reinforcement. Give treats and lots of praise when she does her business outside (high, happy voice, lots of petting). When she has an accident inside, take a deep breath and count to 5 or 10, and immediately take her outside. This will only work if you catch her in the act. If you are gone while she has an accident, do not make a fuss about it when you get home, because she will have already forgotten. Just clean it up and move on with life. Try keeping her locked in a crate while you are gone, or locked in the kitchen or bathroom -- to make clean-ups easier on yourself. You will feel more patient if you are better-prepared for these incidents. Remember she is a baby, like you said, and she's learning. This is a whole new world for her! She wants to make you happy and bond with you. Keep your interactions positive so she associates you with happiness, not fear. The biggest thing to remember is, this too shall pass
She'll grow out of it faster than you know. Hang in there!