Flight
This is likely to be long, I don't do short posts . Am talking as a single mum of an anxious boy and the eldest in a family, so can sympathise with you and ds1.
When did you and your ex split, if you don't mind me asking? Has ds1's anxiety worsened since then? I only ask cos my ds (7) has really bad anxiety, related to things leaving (me, my family, old toys, books, broken furniture, the sticker the dentist gave him ......) and I think it mainly relates back to his uncle, brother and dad leaving his immediate circle in the space of about 8 months.
Anxiety. You may find it helps if you tell ds1 what you are going to do. 'DS1 I am just going to make a cup of tea/put the washing away/put the rubbish out'. It sounds as though he is anxious you are going to leave, and this may well help (especially if you check he has heard you by getting him to repeat it back). It may sound daft, but ds has got to the stage now where I only tell him if I go out the house, the rest of the time he may shout to find out where I am but doesnt have meltdowns because I am not where he expects me to be.
School. This is potentially ringing bells for me, although probably only because of ds's recent experience. It may well be your ds1's anxiety again, but may not be. Which year is he in (1 or 2)? Is he being kept in because he isn't getting his work done? Is he getting any support as he is behind his peers? How far behind is he? DS is starting a new school after Easter due to issues like these. I am not saying your ds is in anything like a situation as bad, but if you want to look here you will see the issues and advice I got about it. (If you don't feel its applicable, don't look, but I am a little worried for your ds, though I do worry easily anyway )
Bedtime/sleep. I have finally given in and ds and I now share a room, albeit in seperate beds. Would you consider this? It may give your ds1 the peace of mind that you are still going to be there in the morning, or that his brother isn't pushing him out, or both. It will probably help the sleep all of you get, and may help improve moods during the day as sleep will be less broken. If you keep his bedroom there, make it his special space, you may find as his anxiety lessens he will spend more time in there and eventually sleep there of his own accord.
Do ds1 and ds2 go to bed at the same time? If so, could ds1 stay up for 30 mins or so after ds2 goes down, and you have some special time with him then, even just a cuddle and a story on the sofa?
When the boys are doing something together, do you tell them both to stop, or just ds1? Eg playing power rangers, if you say 'ds1 and ds2, can you stop doing that please' (or whatever) it will help ds1 feel less singled out, and ds2 may listen as well. If not, you can at least praise ds1 for doing as he is told (as long as he does), so he feels he is being noticed for the good as well.
Would your mum be willing to come and spend some time at yours with you and both boys, so each can have 1-1 at the same time. That way ds2 can be occupied and ds1 can have grown up activities to do. Even quick simple things like icing and decorating a cheap pack of biscuits, but something ds2 is 'too young to do' (even if not strictly true). Preferably your mum could spend time with ds2 so you can with ds1.
How old is ds2? Is he still in a highchair? If so, could you give him something to occupy himself in there, whilst you and ds1 do some baking or similar. Maybe you could make pizza for tea one night (whilst ds2 samples some of the toppings maybe??), or bake a cake.
Lastly, some children cope better when out of the school routine than others. I remember my dbro being a nightmare in the holidays, and ds is harder when he doesnt have his set routine, so the holidays may be causing him to be worse than normal as well.