How to separate Awesome's `rc.lua` configuration into multiple files?

You can simply place code in a separate file and include it with

dofile("somefile.lua")

Note: The working directory is $HOME. To specify a file relative to rc.lua you can use

dofile(awful.util.getdir("config") .. "/" .. "somefile.lua")

If it's more than just some code and it might be used by others as well, it might make sense to create a lua module which can be included with

somemodule = require("somemodule")

To move code into a different file, you create a module and require the module in the rc.lua.

To create a module, you simply call module (name [, ···]) in the script that has the code you pulled out of the original script. Lua reference - module.

To use the module you created, you just call require (modname). Lua reference - require.

There is an excellent tutorial on the Lua wiki that explains this with examples. And if you want to see how module() really works, there is an article on Play With Lua that starts by writing an implementation of module().