The first rule of novices replacing fixtures (or anything) is only mess with the wires that go to the old fixture. Don't touch things that are outside project scope, no matter how interesting they seem. That is to say, resist the urge to learn electrical by dismantling your house. Get a DIY book on the subject and read it through.
Safety Ground wires don't need much thinking, because they all go together.
The clump of all-white wires is certainly neutral, and an appropriate place to terminate the white wire(s) from your fixture. What is always true is that the place the old lamp's white wire went, is correct -- barring previous incompetence of course (and novices are in no position to judge competence).
What remains is the switched-hot wire(s) from the fixture, presuming you want the lamp to be switchable. If that wire comes from the ceiling box, it is usually a solitary (connected to nothing else, who else would want a wire that is only energized with the lamp on?) This will be the wire that went to the lamp's black wire before.
Color coding is often not that helpful. Switched-hot is a type of hot, and all hot wires can be any color not reserved for neutral or ground. Installers get no choice of color since all cables come only black/white or black/white/red. However by convention it's preferred to use red for that when possible. So red is a good bet, and since you say the old lamp's wires went there, that all jibes.
Black and white
Your idea of connecting both lamp whites to the white cluster, and one black to supply black and one black to supply red -- the result was one lamp is always-on, and the other is switched. You may have missed that if you weren't paying close attention. (Light works on a log scale like sound, so half the light is only 3db dimmer. 3db isn't a lot).
In this LED age, it costs so little to run small lights that I have started wiring some lamps to be always-on for safety and put small 3-4 watt LEDs there. ($3-4 a year). In a 2-lamp fixture I'd make one lamp switched and put a very strong LED in it, so you have low/high instead of on/off.
If it also has switched receptacles
Lastly, if you have split bulbs black and red, and it still doesn't switch, there's a fair chance the house also has switched receptacles... and a novice (no names mentioned) replaced the receptacles and wasn't paying attention to the breakaway "tabs" between the two sockets on the hot (brass screw) side. That would defeat the switch, causing the red wire to be always-on.
The cure is to search all the receptacles in the room, looking for red wires or anything abnormal. In such a location (there may be several), get some spare receptacles (they are $3) and break the brass-screw-side tab off. If doing this causes downline receptacles to stop working on both sockets, it was the wrong thing to do; tabs can't be de-broken so swap in a spare receptacle. Needles to say, cut power at the breaker and confirm it's off before opening up a receptacle.
When wiring with cable, and the feed is coming to the light, the standard is to feed a single pole with the white wire (the code requires this) and return with the black wire.
If you connect the white wire to the other white wires at the light fixture you create a dead short when the switch is closed this would trip the GFCI if you are downstream from it. Check that the conductors for the switch are not dead shorting the circuit.
A picture or diagram of your particular situation might help if the previous tip doesn't.
Good luck!
Best Answer
Based on your description and the picture (thank you) the red wire is the hot switched loop to control your light. Connect your black wire from the light to the red wire in the box, the white to the white and the green from the light to the bare ground I see lurking in the back of the box.
You should be good to go.