Flattery is forbidden
Rabbi Elazar says: Any person who has flattery in him brings wrath to the world, as it is stated: “But those with flattery in their hearts bring about wrath” (Job 36:13). And moreover, his prayer is not heard, as it is stated in that same verse: “They do not cry for help when He binds them.”
There are exceptions for example your wife for peace, you teacher to teach you and for peace (to protect yourself)
Pele Yoetz
flattery our Sages allowed towards a person’s wife, for the sake of domestic peace, and towards his rabbi, so that he should teach him Torah. A person is also allowed to flatter wicked people due to the ways of peace.
but it is good to be nice (to say what people what to hear, even when it is not "true") always and to all peaple/creations
talmud:
Beit Shammai said to Beit Hillel: In a case where the bride was lame or blind, does one say with regard to her: A fair and attractive bride? But the Torah states: “Keep you from a false matter” (Exodus 23:7). Beit Hillel said to Beit Shammai: According to your statement, with regard to one who acquired an inferior acquisition from the market, should another praise it and enhance its value in his eyes or condemn it and diminish its value in his eyes? You must say that he should praise it and enhance its value in his eyes and refrain from causing him anguish. From here the Sages said: A person’s disposition should always be empathetic with mankind, and treat everyone courteously. In this case too, once the groom has married his bride, one praises her as being fair and attractive.
לעשות לאיש ואיש כרצונו
הָיָה דִּבּוּרוֹ בְּנַחַת עִם הַבְּרִיּוֹת וְדַעְתּוֹ מְעֹרֶבֶת עִמָּהֶם
his social conduct is [attractive] to others
what is the difference? (when is it being nice when is it flattery?)
sources please