Why is 富 character under 宀 40th radical? why isn't it under 102nd radical 田 ?
Why is 仏 character under 人 9th radical? why isn't it under 28nd radical 厶 ? etc.
what is the logic for assigning Kanji characters to certain radicals?
In principle, it's arbitrary. Dictionary makers are free to put 富 under whichever section they want, and the same goes for 仏 or any other character. And in fact, editors of some dictionaries put characters under different radicals; see for example the New Nelson. As such, they can have different motivations, and it's impossible to answer what the motivation is in every case.
However, 富 fits a very common pattern: like the majority of kanji, it can be divided into a semantic component and a phonetic component. In such cases, the semantic portion is usually the radical. In this character, 宀 is the semantic portion, while 畐 is the phonetic portion.
Likewise, 仏 consists of 亻 and 厶. The former is the semantic and the radical, and the latter is the phonetic.
There are other patterns you can recognize. For example:
In some cases, you'll simply have to memorize the radicals. For example, 謄, 騰, and 勝 and all have 朕 as a phonetic! So the radicals are in the unexpected lower-right position, and you'll find these characters under 言, 馬, and 力. As you come to recognize phonetic elements and identify them with patterns in 音読み, identifying radicals like these will be easier, and over time, you'll simply come to remember them.
(In principle, you can tell that the radical is in lower-right position in the above because those kanji aren't left-right divisible, but in practice this is difficult because (for example) valid left and right sides may include characters that are no longer used or were never used in Japanese.)
And there will always be exceptions to the above generalizations. For example, the kanji 錦 has the same on reading as its left side (金), so it appears that the phonetic portion is on the left. But in this case, that's also the radical! Why? Well, the right side can't be the radical simply because it's not one of the 214 choices! Likewise, the radical for 難 is on the right. Why? Again, the left side isn't one of the 214!
So it's a complicated system, and it's likely to surprise you. But hopefully the more you learn, the more it will make sense, and the rest you'll be able to memorize or look up as need be. (After all, it is just a system for indexing dictionaries.)