What are old ways to store milk without refrigerator. I boiled twice a day still it spoils.
You really just have to find a way to keep it cold. The only way to keep perishable food from spoiling is to keep it below 40F/4C. If you can't do that, you'll have to use it fresh. UHT milk may help with that, because it's shelf-stable before opening, so you may be able to get a larger number of smaller size ones that you can actually finish quickly after opening.
There are some things you can make out of milk that have longer life at room temperature, but they're not really milk anymore.
Boiling really can't fix this, because it doesn't kill everything, because the nasty stuff produced by bacteria can survive even if the bacteria dies, and because whatever's left (or whatever drifts in and recontaminates it) is just going to have a nice friendly environment to grow in after it cools back into the danger zone.
Two options I can think of, both change what is being stored more than how.
Dehydrated milk is widely available, and dehydration is a time tested and useful preservative method. You would reconstitute only as much milk as you need at any given time, so there wouldn't be (much) extra to spoil. Nonfat dehydrated milk is somewhat more common than full-fat, for some applications it might not matter but you should be aware because for some applications it does.
A bit of a sideways option, taken from medieval times, is to use almond-milk. Almonds (dry) will store and keep pretty well, even for years, and they can be ground and steeped (basic nut-milk processing) on an as-needed basis. It does take a bit more work to produce said milk, and the product isn't the same as cows' milk - so dehydrated milk is likely a better option - but I thought the historical authenticity of this storage method made it worth mentioning. Plus it amuses me.
The only other option I'm aware of that would work for milk rather than a derivative product (like cheese, etc) is cold storage. Before refrigerators were common, ice boxes were used - with ice kept in insulated containers, pretty much equivalent to coolers. This is a more convenient option nowadays with ice for sale at pretty much every store. Or even before that, things would be kept cold with insulated rooms (like caves or cellars) packed with snow and ice... between the square-cube law (volume vs surface area) and the insulation of thick walls and earth, such a room could be kept cold for quite some time... like, months after the snow and thus ice availability ended, with people even shipping or selling ice stored this way year-round. Or, to summarize, you can use insulation to keep your milk cool with ice (not difficult to purchase), and if a large enough amount is tightly packed and well insulated that ice can keep your milk cold for a long time.
Google "evaporative refrigeration" for some do it yourself ideas. It will not keep things as long as electric refrigeration, not ever close, but can extend stuff for some time. It is also a back country camping trick.
The basic very old time technique is to dig a hole, line it with sand, get the sand moist, put food in and cover. The water will slowly evaporate which will lower the temperature some. Not the 32-40F you are looking for with modern refrigeration, but better than room temp. A home brew version is to get a couple large terra cotta or clay pots, one a size larger than the other and line the gap between with sand to simulate the hole, moisten the sand. This can be done without the sand or even with a single pot, metal wrapped in moist towels, etc. Options are available, but many options will lower the effectiveness or may require water be added more often, but can help.
Again, these methods are not going to get you to modern refrigeration methods lengths of usability. But, they may help if they are viable for you. It may get you a few days, but not weeks. They also simply do not tend to work for mold prone items as the high humidity can definitely promote spore growth. It is a non-electric method that for generations was common practice but has been lost to most of us which is worth remembering sometimes. I have used it and known people who it was the only methods they used for trips to the off grid cabin.