First detail: Please read the posting guidelines.
I don't know if you're a student or what you've studied so far. Can you share anything that you've tried or thought about?
When I'm confused about an exercise, I start with paper and pencil -- to sort out things (draw a picture, try something similar with smaller numbers, make a table of results, etc.) In other words, brainstorm and experiment.
Here's one way to try understand the question. Mark off seven columns on a sheet of paper. Give the seven people names:
A,B,C,D are boys and X,Y,Z are girls
Now, in the first rows on your paper, figure out how many different ways two of those girls can be put in column one and column seven. In other words, how many ordered pairs (permutations) of girls are possible out of three girls available?
Now that you have all possible rows with girls at each end, think about five students remaining to be seated in each row. How many ways can they be arranged in columns 2-6? In other words, how many permutations of five people are there?
Multiply the two results, to get the total number of arrangements possible with girls at each end.
Start over, thinking about boys at each end.
If you've never done combinations, permutations or counting exercises before, be sure to let us know. Otherwise, please share some work. Thanks!
?