If you like nail polish at all and you use it incessantly, you will get yellow nails. No amount of base coat will protect them from getting stained, but it doesn’t matter because that’s what it is. A Stain. Like most stains, they can be removed but if you continue using nail polish, it’s moot.
If you do care about having white nails though, you can try this:
Take some whitening toothpaste and brush your nails for 1 – 2 minutes and you will get a whiter tone. It’s not magic though, don’t expect the stains to be fully gone, but it will lighten the nails a bit.