Notice how 7,8,10,11, and 12 are all perfect squares. A good way to tell if a trinomial can be factored into a perfect square is if the square root of the coefficient of your variable multiplied by the square root of the constant (number with no variable) multiplied by 2 equals the middle term's coefficient.
For example, take 4x^2+16x+16. Taking the square root of 4 gives us 2. Taking the square root of 16 gives us 4. So, 2*2*4=16, which is our middle term, thus proving that this trinomial is indeed a perfect square.