Soak cod in a large bowl of water in the refrigerator for 24 hours, changing soaking water 4 times to remove excess salt.
Drain water off cod; add lemon juice and salt. Let marinate in the refrigerator, about 1 hour.
Preheat oven to 350 degrees F (175 degrees C).
Arrange layers of cod, potatoes, onions, and tomatoes in a large baking dish. Place bay leaves on top. Drizzle olive oil over baking dish and season with salt.
Bake in the preheated oven until potatoes are tender and cod flakes easily with a fork, about 30 minutes. Add olives and parsley and continue baking until heated through, about 3 minutes more.