I can't really see your screenshot, but it looks like a light green header within a dark green outline. In Disk Management that usually denotes an Extended partition. You cannot expand partition 2 because there is another partition (the Extended partition) in the way.
Many people fail to understand the distinction between "Free Space" and "Unallocated Space". (That's not surprising, given Microsoft itself has a predilection for misusing terminology -- hence, the confusion nowadays with seemingly simple terms like "drive" or "boot partition".) In this case, Free Space means unused space *within* a partition, while Unallocated Space would mean space *not part of* any partition. Disk Management can only expand a partition (such as partition 2) into Unallocated Space. It cannot expand into Free Space because the partition enclosing the Free Space is ... [drumroll], a *partition* ... and in the way.
This might all be a little more obvious to you if you were using a real partition manager. A real partition manager would clearly show the green area as being a partition. Disk Management is not a real partition manager, it only pretends to be one. It's function-limited and glosses over the details of what's going on, leading to confusion and misunderstanding.
You should be able to right-click the green area and select "Delete". That should return the space to "Unallocated", and subsequently allow you to expand partition 2.