We know each animal has one head. But a chicken has 2 legs and a pig has 4 legs. Set up a system of equations.
2x+4y=100 (where x is the number of chickens and y is the number of pigs)
x+y=30
You can do the solving work (because is looks really messy in paragraph form) but if you solve for x in the bottom equation you get -y+30. Now plug in (-y+30) in for x in your top equation and solve for y to get 20. Since you know that x = -y+30, plug in 20. x=-20+30 simplifies to x=10.
x (number of chickens) = 10
y (number of pigs) = 20
I hope this helps your solving systems of equations.