Battery maintenance G14 (G15, G16)

I want to put my M850i convertible for 3-4 months in Malaga in a long term garage. How can I prevent the car from getting a problem with the battery during this time? How does battery maintenance work if you don’t have access to a power outlet?