How do I know my baby is getting enough to eat if he spits up frequently?

Spitty babies. The bottom line here is in the numbers. The newborn and young infant should gain about an ounce a day (some more, some less based on birth factors). If your baby is meeting those weight gain goals, you can rest assured that enough is staying down despite the spit up. If your baby is not, or if s/he is experiencing pain associated with feeding or spit up, be sure to talk with your pediatrician.
Track weight gain. As long as your baby continues to gain weight, s/he is probably getting enough to eat. The baby should be satisfied for at least two hours after a feed, so if the baby cries sooner than that and seems hungry, s/he may not be getting enough or may be spitting up too much. A baby should have at least six wet diapers a day; if s/he has fewer, s/he could be dehydrated from lack of adequate intake.