What To Do:
Its pretty simple, but its a common mistake a lot of people make. DO NOT PUMP THE KEG BEFORE POURING THE FIRST BEER OF A NEW KEG!
Like I said, simple. The keg comes pressurized, if it was not, it would go flat. So when you first tap the keg its as if its already pumped as much as it can be, so do not overpump it. This is what causes foam. Pour your first few beers without pumping and this will help minimize the amount of foam coming out of the keg when you first tap it.