The ex-dividend date is the day from which buying a share no longer entitles you to the next announced dividend. Buy the day before, you collect; buy on that day or later, the payment goes to the seller. It is the date that truly matters in the whole dividend calendar — and the biggest source of beginner confusion.
For you there is only one operational rule: buy before the ex-date if you want that specific payment.
At the ex-date open, the price theoretically discounts the exact dividend amount: the company is worth that much less because that cash is already committed to the previous day's shareholders. A €50 stock with a €1 dividend will open around €49 — normal market noise can mask it, but the adjustment is there.
The logical consequence of that adjustment: there is no trick in buying the day before, collecting, and selling the next day. What you gain in dividend you lose in price — and on top you pay tax on the payment and fees on both trades. Dividend-capture strategies are, for retail investors, an elaborate way of gifting money to the tax office and the broker.
At the latest, the business day before the ex-dividend date. Buying on the ex-date itself no longer entitles you to the announced payment.
Yes: the right was fixed at the previous day's close. You can sell at the ex-date open and the dividend will still arrive on the payment date.
On each company's investor relations site and in the dividend calendars of financial portals and brokers, which publish them weeks in advance.